(t *testing.T)
| 278 | } |
| 279 | |
| 280 | func TestExecuteCodeBlock_LauncherNotDefined(t *testing.T) { |
| 281 | codeBlock := CodeBlock{ |
| 282 | Lang: "unknown", |
| 283 | Code: `echo "Hello, {{.arg1}}"`, |
| 284 | Config: ConfigBlock{SheBang: false}, |
| 285 | } |
| 286 | args := []string{"World"} |
| 287 | wantErr := ErrNoInfostringOrShebang |
| 288 | |
| 289 | err := executeCodeBlock(&codeBlock, args...) |
| 290 | |
| 291 | if wantErr != nil { |
| 292 | if !errors.Is(err, wantErr) { |
| 293 | t.Errorf("executeCodeBlock() error = %v, wantErr %v", err, wantErr) |
| 294 | } |
| 295 | } else if err != nil { |
| 296 | t.Errorf("executeCodeBlock() error = %v, wantErr %v", err, wantErr) |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | func TestExecuteCodeBlock_DependencyMissing(t *testing.T) { |
| 301 | launchers = map[string]LauncherBlock{"sh": {"sh", "sh"}, "bash": {"sh", "sh"}, "env": {"/usr/bin/env", "env"}} |
nothing calls this directly
no test coverage detected