MCPcopy Create free account
hub / github.com/dim0x69/mdx / TestExecuteCodeBlock_LauncherNotDefined

Function TestExecuteCodeBlock_LauncherNotDefined

exec_test.go:280–298  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

278}
279
280func 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
300func TestExecuteCodeBlock_DependencyMissing(t *testing.T) {
301 launchers = map[string]LauncherBlock{"sh": {"sh", "sh"}, "bash": {"sh", "sh"}, "env": {"/usr/bin/env", "env"}}

Callers

nothing calls this directly

Calls 1

executeCodeBlockFunction · 0.85

Tested by

no test coverage detected