(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func TestParseExecErrors(t *testing.T) { |
| 151 | t.Run("missing env-file", func(t *testing.T) { |
| 152 | execOpts := withDefaultOpts(ExecOptions{}) |
| 153 | assert.Check(t, execOpts.EnvFile.Set("no-such-env-file")) |
| 154 | execConfig, err := parseExec(execOpts, &configfile.ConfigFile{}) |
| 155 | assert.ErrorContains(t, err, "no-such-env-file") |
| 156 | assert.Check(t, os.IsNotExist(err)) |
| 157 | assert.Check(t, execConfig == nil) |
| 158 | }) |
| 159 | t.Run("invalid detach keys", func(t *testing.T) { |
| 160 | execOpts := withDefaultOpts(ExecOptions{ |
| 161 | DetachKeys: "shift-a", |
| 162 | }) |
| 163 | execConfig, err := parseExec(execOpts, &configfile.ConfigFile{}) |
| 164 | assert.Check(t, is.ErrorContains(err, "invalid detach keys (shift-a):")) |
| 165 | assert.Check(t, is.Nil(execConfig)) |
| 166 | }) |
| 167 | } |
| 168 | |
| 169 | func TestRunExec(t *testing.T) { |
| 170 | testcases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…