(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestNewExecutor_Defaults(t *testing.T) { |
| 13 | executor := NewExecutor("test title", "echo", "hello") |
| 14 | |
| 15 | if executor.title != "test title" { |
| 16 | t.Errorf("title = %q, want %q", executor.title, "test title") |
| 17 | } |
| 18 | if executor.command != "echo" { |
| 19 | t.Errorf("command = %q, want %q", executor.command, "echo") |
| 20 | } |
| 21 | if len(executor.args) != 1 || executor.args[0] != "hello" { |
| 22 | t.Errorf("args = %v, want [hello]", executor.args) |
| 23 | } |
| 24 | if executor.msys2Env { |
| 25 | t.Error("msys2Env should default to false") |
| 26 | } |
| 27 | if executor.msvcEnvs != "" { |
| 28 | t.Error("msvcEnvs should default to empty") |
| 29 | } |
| 30 | if executor.workDir != "" { |
| 31 | t.Error("workDir should default to empty") |
| 32 | } |
| 33 | if executor.logPath != "" { |
| 34 | t.Error("logPath should default to empty") |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestExecutor_BuilderChain(t *testing.T) { |
| 39 | executor := NewExecutor("title", "cmd"). |
nothing calls this directly
no test coverage detected