(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func TestErrHelp(t *testing.T) { |
| 26 | exitCode := (&mainCmd{ |
| 27 | Stdin: strings.NewReader(""), |
| 28 | Stdout: testWriter{t}, |
| 29 | Stderr: testWriter{t}, |
| 30 | }).Run([]string{"-h"}) |
| 31 | if want := 0; exitCode != want { |
| 32 | t.Errorf("exit code = %d, want %d", exitCode, want) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | // TestGolden runs errtrace on all .go files inside testdata/golden, |
| 37 | // and compares the output to the corresponding .golden file. |