(t *testing.T)
| 144 | } |
| 145 | |
| 146 | func TestBasicFail(t *testing.T) { |
| 147 | t.Parallel() |
| 148 | |
| 149 | command := &com.Command{ |
| 150 | Binary: "bash", |
| 151 | Args: []string{"-c", "--", "does-not-exist"}, |
| 152 | } |
| 153 | |
| 154 | err := command.Run(context.WithValue(context.Background(), com.LoggerKey, t)) |
| 155 | |
| 156 | assertive.ErrorIsNil(t, err, "Err") |
| 157 | |
| 158 | res, err := command.Wait() |
| 159 | |
| 160 | assertive.ErrorIs(t, err, com.ErrExecutionFailed, "Err") |
| 161 | assertive.IsEqual(t, 127, res.ExitCode, "ExitCode") |
| 162 | assertive.IsEqual(t, "", res.Stdout, "Stdout") |
| 163 | assertive.HasSuffix(t, res.Stderr, "does-not-exist: command not found\n", "Stderr") |
| 164 | } |
| 165 | |
| 166 | func TestWorkingDir(t *testing.T) { |
| 167 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…