(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestIOStreams_pager(t *testing.T) { |
| 28 | t.Skip("TODO: fix this test in race detection mode") |
| 29 | ios, _, stdout, _ := Test() |
| 30 | ios.SetStdoutTTY(true) |
| 31 | ios.SetPager(fmt.Sprintf("%s -test.run=TestHelperProcess --", os.Args[0])) |
| 32 | t.Setenv("GH_WANT_HELPER_PROCESS", "1") |
| 33 | if err := ios.StartPager(); err != nil { |
| 34 | t.Fatal(err) |
| 35 | } |
| 36 | if _, err := fmt.Fprintln(ios.Out, "line1"); err != nil { |
| 37 | t.Errorf("error writing line 1: %v", err) |
| 38 | } |
| 39 | if _, err := fmt.Fprintln(ios.Out, "line2"); err != nil { |
| 40 | t.Errorf("error writing line 2: %v", err) |
| 41 | } |
| 42 | ios.StopPager() |
| 43 | wants := "pager: line1\npager: line2\n" |
| 44 | if got := stdout.String(); got != wants { |
| 45 | t.Errorf("expected %q, got %q", wants, got) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func TestHelperProcess(t *testing.T) { |
| 50 | if os.Getenv("GH_WANT_HELPER_PROCESS") != "1" { |
nothing calls this directly
no test coverage detected