MCPcopy Create free account
hub / github.com/astercloud/aster / TestBashRuntime_Execute

Function TestBashRuntime_Execute

pkg/tools/bridge/runtime_test.go:110–133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

108}
109
110func TestBashRuntime_Execute(t *testing.T) {
111 runtime := NewBashRuntime(nil)
112
113 if !runtime.IsAvailable() {
114 t.Skip("Bash not available")
115 }
116
117 ctx := context.Background()
118 code := `echo "Hello, World!"`
119 input := map[string]any{}
120
121 result, err := runtime.Execute(ctx, code, input)
122 if err != nil {
123 t.Fatalf("Execute failed: %v", err)
124 }
125
126 if !result.Success {
127 t.Errorf("expected success, got error: %s", result.Error)
128 }
129
130 if result.Output != "Hello, World!" {
131 t.Errorf("expected 'Hello, World!', got %v", result.Output)
132 }
133}
134
135func TestRuntimeManager_Execute(t *testing.T) {
136 manager := NewRuntimeManager(nil)

Callers

nothing calls this directly

Calls 3

IsAvailableMethod · 0.95
ExecuteMethod · 0.95
NewBashRuntimeFunction · 0.85

Tested by

no test coverage detected