| 45 | } |
| 46 | |
| 47 | func TestShellTool_HandlerWithCwd(t *testing.T) { |
| 48 | t.Parallel() |
| 49 | tool := New(nil, &config.RuntimeConfig{Config: config.Config{WorkingDir: t.TempDir()}}) |
| 50 | tmpDir := t.TempDir() |
| 51 | |
| 52 | result, err := tool.handler.RunShell(t.Context(), RunShellArgs{ |
| 53 | Cmd: "pwd", |
| 54 | Cwd: tmpDir, |
| 55 | }) |
| 56 | require.NoError(t, err) |
| 57 | // The output might contain extra newlines or other characters, |
| 58 | // so we just check if it contains the temp dir path |
| 59 | assert.Contains(t, result.Output, tmpDir) |
| 60 | } |
| 61 | |
| 62 | func TestRunShellArgs_UnmarshalJSON_AcceptsCmdAndCommand(t *testing.T) { |
| 63 | t.Parallel() |