MCPcopy Create free account
hub / github.com/aurora-develop/aurora / TestShellCmdToString

Function TestShellCmdToString

internal/toolcall/parser_test.go:265–282  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

263}
264
265func TestShellCmdToString(t *testing.T) {
266 cases := []struct {
267 in any
268 want string
269 }{
270 {"ls -la", "ls -la"},
271 {[]any{"bash", "-c", "ls"}, "ls"},
272 {[]any{"powershell", "-Command", "Get-Process"}, "Get-Process"},
273 {[]any{"pwsh", "-Command", "A", "B"}, "A B"},
274 {[]any{"ls", "-la"}, "ls -la"},
275 {[]string{"ls", "-la"}, "ls -la"},
276 }
277 for _, c := range cases {
278 if got := cmdToString(c.in); got != c.want {
279 t.Errorf("cmdToString(%#v) = %q, want %q", c.in, got, c.want)
280 }
281 }
282}
283
284func TestResolveShellTool(t *testing.T) {
285 tools := []official.Tool{

Callers

nothing calls this directly

Calls 1

cmdToStringFunction · 0.85

Tested by

no test coverage detected