(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestOutput_emptyOutputs(t *testing.T) { |
| 98 | originalState := states.NewState() |
| 99 | statePath := testStateFile(t, originalState) |
| 100 | |
| 101 | p := testProvider() |
| 102 | view, done := testView(t) |
| 103 | c := &OutputCommand{ |
| 104 | Meta: Meta{ |
| 105 | WorkingDir: workdir.NewDir("."), |
| 106 | testingOverrides: metaOverridesForProvider(p), |
| 107 | View: view, |
| 108 | }, |
| 109 | } |
| 110 | |
| 111 | args := []string{ |
| 112 | "-no-color", |
| 113 | "-state", statePath, |
| 114 | } |
| 115 | code := c.Run(args) |
| 116 | output := done(t) |
| 117 | if code != 0 { |
| 118 | t.Fatalf("bad: \n%s", output.Stderr()) |
| 119 | } |
| 120 | // Warning diagnostics should go to stdout |
| 121 | if got, want := output.Stdout(), "Warning: No outputs found"; !strings.Contains(got, want) { |
| 122 | t.Fatalf("bad output: expected to contain %q, got:\n%s", want, got) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | func TestOutput_badVar(t *testing.T) { |
| 127 | originalState := states.BuildState(func(s *states.SyncState) { |
nothing calls this directly
no test coverage detected