Skip to content

Commit 2d98261

Browse files
committed
tmp: lets find out
1 parent ee76c2f commit 2d98261

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

jscomp/build_tests/cli_help/input.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,179 +73,219 @@ const dumpHelp =
7373
"`rescript dump` dumps the information for the target\n";
7474

7575
// Shows build help with --help arg
76+
console.group("build --help");
7677
let out = child_process.spawnSync(`../../../rescript`, ["build", "--help"], {
7778
encoding: "utf8",
7879
cwd: __dirname,
7980
});
8081
assert.equal(out.stdout, buildHelp);
8182
assert.equal(out.stderr, "");
8283
assert.equal(out.status, 0);
84+
console.groupEnd();
8385

86+
console.group("build -w --help");
8487
out = child_process.spawnSync(`../../../rescript`, ["build", "-w", "--help"], {
8588
encoding: "utf8",
8689
cwd: __dirname,
8790
});
8891
assert.equal(out.stdout, buildHelp);
8992
assert.equal(out.stderr, "");
9093
assert.equal(out.status, 0);
94+
console.groupEnd();
9195

96+
console.group("-w --help");
9297
out = child_process.spawnSync(`../../../rescript`, ["-w", "--help"], {
9398
encoding: "utf8",
9499
cwd: __dirname,
95100
});
96101
assert.equal(out.stdout, cliHelp);
97102
assert.equal(out.stderr, "");
98103
assert.equal(out.status, 0);
104+
console.groupEnd();
99105

100106
// Shows cli help with --help arg even if there are invalid arguments after it
107+
console.group("--help -w");
101108
out = child_process.spawnSync(`../../../rescript`, ["--help", "-w"], {
102109
encoding: "utf8",
103110
cwd: __dirname,
104111
});
105112
assert.equal(out.stdout, cliHelp);
106113
assert.equal(out.stderr, "");
107114
assert.equal(out.status, 0);
115+
console.groupEnd();
108116

109117
// Shows build help with -h arg
118+
console.group("build -h");
110119
out = child_process.spawnSync(`../../../rescript`, ["build", "-h"], {
111120
encoding: "utf8",
112121
cwd: __dirname,
113122
});
114123
assert.equal(out.stdout, buildHelp);
115124
assert.equal(out.stderr, "");
116125
assert.equal(out.status, 0);
126+
console.groupEnd();
117127

118128
// Exits with build help with unknown arg
129+
console.group("build -foo");
119130
out = child_process.spawnSync(`../../../rescript`, ["build", "-foo"], {
120131
encoding: "utf8",
121132
cwd: __dirname,
122133
});
123134
assert.equal(out.stdout, "");
124135
assert.equal(out.stderr, 'Error: Unknown option "-foo".\n' + buildHelp);
125136
assert.equal(out.status, 2);
137+
console.groupEnd();
126138

127139
// Shows cli help with --help arg
140+
console.group("--help");
128141
out = child_process.spawnSync(`../../../rescript`, ["--help"], {
129142
encoding: "utf8",
130143
cwd: __dirname,
131144
});
132145
assert.equal(out.stdout, cliHelp);
133146
assert.equal(out.stderr, "");
134147
assert.equal(out.status, 0);
148+
console.groupEnd();
135149

136150
// Shows cli help with -h arg
151+
console.group("-h");
137152
out = child_process.spawnSync(`../../../rescript`, ["-h"], {
138153
encoding: "utf8",
139154
cwd: __dirname,
140155
});
141156
assert.equal(out.stdout, cliHelp);
142157
assert.equal(out.stderr, "");
143158
assert.equal(out.status, 0);
159+
console.groupEnd();
144160

145161
// Shows cli help with help command
162+
console.group("help");
146163
out = child_process.spawnSync(`../../../rescript`, ["help"], {
147164
encoding: "utf8",
148165
cwd: __dirname,
149166
});
150167
assert.equal(out.stdout, cliHelp);
151168
assert.equal(out.stderr, "");
152169
assert.equal(out.status, 0);
170+
console.groupEnd();
153171

154172
// Exits with cli help with unknown command
173+
console.group("built");
155174
out = child_process.spawnSync(`../../../rescript`, ["built"], {
156175
encoding: "utf8",
157176
cwd: __dirname,
158177
});
159178
assert.equal(out.stdout, "");
160179
assert.equal(out.stderr, `Error: Unknown command "built".\n` + cliHelp);
161180
assert.equal(out.status, 2);
181+
console.groupEnd();
162182

163183
// Exits with build help with unknown args
184+
console.group("-foo");
164185
out = child_process.spawnSync(`../../../rescript`, ["-foo"], {
165186
encoding: "utf8",
166187
cwd: __dirname,
167188
});
168189
assert.equal(out.stdout, "");
169190
assert.equal(out.stderr, 'Error: Unknown option "-foo".\n' + buildHelp);
170191
assert.equal(out.status, 2);
192+
console.groupEnd();
171193

172194
// Shows clean help with --help arg
195+
console.group("clean --help");
173196
out = child_process.spawnSync(`../../../rescript`, ["clean", "--help"], {
174197
encoding: "utf8",
175198
cwd: __dirname,
176199
});
177200
assert.equal(out.stdout, cleanHelp);
178201
assert.equal(out.stderr, "");
179202
assert.equal(out.status, 0);
203+
console.groupEnd();
180204

181205
// Shows clean help with -h arg
206+
console.group("clean -h");
182207
out = child_process.spawnSync(`../../../rescript`, ["clean", "-h"], {
183208
encoding: "utf8",
184209
cwd: __dirname,
185210
});
186211
assert.equal(out.stdout, cleanHelp);
187212
assert.equal(out.stderr, "");
188213
assert.equal(out.status, 0);
214+
console.groupEnd();
189215

190216
// Exits with clean help with unknown arg
217+
console.group("clean -foo");
191218
out = child_process.spawnSync(`../../../rescript`, ["clean", "-foo"], {
192219
encoding: "utf8",
193220
cwd: __dirname,
194221
});
195222
assert.equal(out.stdout, "");
196223
assert.equal(out.stderr, 'Error: Unknown option "-foo".\n' + cleanHelp);
197224
assert.equal(out.status, 2);
225+
console.groupEnd();
198226

199227
// Shows format help with --help arg
228+
console.group("format --help");
200229
out = child_process.spawnSync(`../../../rescript`, ["format", "--help"], {
201230
encoding: "utf8",
202231
cwd: __dirname,
203232
});
204233
assert.equal(out.stdout, formatHelp);
205234
assert.equal(out.stderr, "");
206235
assert.equal(out.status, 0);
236+
console.groupEnd();
207237

208238
// Shows format help with -h arg
239+
console.group("format -h");
209240
out = child_process.spawnSync(`../../../rescript`, ["format", "-h"], {
210241
encoding: "utf8",
211242
cwd: __dirname,
212243
});
213244
assert.equal(out.stdout, formatHelp);
214245
assert.equal(out.stderr, "");
215246
assert.equal(out.status, 0);
247+
console.groupEnd();
216248

217249
// Shows convert help with --help arg
250+
console.group("convert --help");
218251
out = child_process.spawnSync(`../../../rescript`, ["convert", "--help"], {
219252
encoding: "utf8",
220253
cwd: __dirname,
221254
});
222255
assert.equal(out.stdout, convertHelp);
223256
assert.equal(out.stderr, "");
224257
assert.equal(out.status, 0);
258+
console.groupEnd();
225259

226260
// Shows convert help with -h arg
261+
console.group("convert -h");
227262
out = child_process.spawnSync(`../../../rescript`, ["convert", "-h"], {
228263
encoding: "utf8",
229264
cwd: __dirname,
230265
});
231266
assert.equal(out.stdout, convertHelp);
232267
assert.equal(out.stderr, "");
233268
assert.equal(out.status, 0);
269+
console.groupEnd();
234270

235271
// Shows dump help with --help arg
272+
console.group("dump --help");
236273
out = child_process.spawnSync(`../../../rescript`, ["dump", "--help"], {
237274
encoding: "utf8",
238275
cwd: __dirname,
239276
});
240277
assert.equal(out.stdout, dumpHelp);
241278
assert.equal(out.stderr, "");
242279
assert.equal(out.status, 0);
280+
console.groupEnd();
243281

244282
// Shows dump help with -h arg
283+
console.group("dump -h");
245284
out = child_process.spawnSync(`../../../rescript`, ["dump", "-h"], {
246285
encoding: "utf8",
247286
cwd: __dirname,
248287
});
249288
assert.equal(out.stdout, dumpHelp);
250289
assert.equal(out.stderr, "");
251290
assert.equal(out.status, 0);
291+
console.groupEnd();

0 commit comments

Comments
 (0)