@@ -258,18 +258,21 @@ func TestMainArgList(t *testing.T) {
258
258
}
259
259
260
260
osWrapper .Setargs ([]string {"-list" , "!" })
261
- expectedOutput := "Unknown time zone !"
261
+ expectedErrOutput := "Unknown time zone !"
262
262
parseMainArgsWithPanicRecovery (& err )
263
263
if err != nil {
264
- t .Errorf ("Unexpected failure for -list flag: %v" , err )
264
+ t .Errorf ("Unexpected failure for ` -list !` flag: %v" , err )
265
265
}
266
266
if osWrapper .ExitCode == nil {
267
- t .Error ("Main -list should exit, but did not" )
267
+ t .Error ("Main ` -list !` should exit, but did not" )
268
268
} else if * osWrapper .ExitCode != 3 {
269
- t .Errorf ("Main -list should exit with code 3, but got %v" , * osWrapper .ExitCode )
269
+ t .Errorf ("Main ` -list !` should exit with code 3, but got %v" , * osWrapper .ExitCode )
270
270
}
271
- if output := strings .TrimSpace (osWrapper .ConsumeStderr ()); output != expectedOutput {
272
- t .Errorf ("Main -list should have printed '%v', but got '%v'" , expectedOutput , output )
271
+ if errOutput := strings .TrimSpace (osWrapper .ConsumeStderr ()); errOutput != expectedErrOutput {
272
+ t .Errorf ("Main `-list !` should have stderr '%v', but got '%v'" , expectedErrOutput , errOutput )
273
+ }
274
+ if stdOutput := osWrapper .ConsumeStdout (); len (stdOutput ) > 0 {
275
+ t .Errorf ("Main `-list !` should have empty stdout, but got '%v'" , stdOutput )
273
276
}
274
277
}
275
278
0 commit comments