|
@@ -247,6 +247,16 @@ func TestInteractiveCommands(t *testing.T) {
|
247
|
247
|
"ignore": "ignore",
|
248
|
248
|
},
|
249
|
249
|
},
|
|
250
|
+ {
|
|
251
|
+ "top10 --cum focus1 -ignore focus2",
|
|
252
|
+ map[string]string{
|
|
253
|
+ "functions": "true",
|
|
254
|
+ "nodecount": "10",
|
|
255
|
+ "cum": "true",
|
|
256
|
+ "focus": "focus1|focus2",
|
|
257
|
+ "ignore": "ignore",
|
|
258
|
+ },
|
|
259
|
+ },
|
250
|
260
|
{
|
251
|
261
|
"dot",
|
252
|
262
|
map[string]string{
|
|
@@ -288,14 +298,23 @@ func TestInteractiveCommands(t *testing.T) {
|
288
|
298
|
"output": "out",
|
289
|
299
|
},
|
290
|
300
|
},
|
|
301
|
+ {
|
|
302
|
+ "999",
|
|
303
|
+ nil, // Error
|
|
304
|
+ },
|
291
|
305
|
}
|
292
|
306
|
|
293
|
307
|
for _, tc := range testcases {
|
294
|
308
|
cmd, vars, err := parseCommandLine(strings.Fields(tc.input))
|
295
|
|
- vars = applyCommandOverrides(cmd, vars)
|
|
309
|
+ if tc.want == nil && err != nil {
|
|
310
|
+ // Error expected
|
|
311
|
+ continue
|
|
312
|
+ }
|
296
|
313
|
if err != nil {
|
297
|
314
|
t.Errorf("failed on %q: %v", tc.input, err)
|
|
315
|
+ continue
|
298
|
316
|
}
|
|
317
|
+ vars = applyCommandOverrides(cmd, vars)
|
299
|
318
|
|
300
|
319
|
for n, want := range tc.want {
|
301
|
320
|
if got := vars[n].stringValue(); got != want {
|