(t *testing.T)
| 236 | } |
| 237 | |
| 238 | func TestSessionNewRejectsRelativeCWD(t *testing.T) { |
| 239 | t.Parallel() |
| 240 | |
| 241 | tests := []string{".", "../project"} |
| 242 | for _, cwd := range tests { |
| 243 | t.Run(cwd, func(t *testing.T) { |
| 244 | t.Parallel() |
| 245 | |
| 246 | code, _, stderr := executeRootCommandWithExit(t, newTestDeps(t, &stubClient{}), |
| 247 | "session", "new", "--cwd", cwd, |
| 248 | ) |
| 249 | if code != 1 { |
| 250 | t.Fatalf("executeRootCommandWithExit(%q) code = %d, want 1", cwd, code) |
| 251 | } |
| 252 | if !strings.Contains(stderr, "--cwd must be an absolute path") { |
| 253 | t.Fatalf("stderr = %q, want absolute path validation message", stderr) |
| 254 | } |
| 255 | }) |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | func TestSessionListPassesWorkspaceFilter(t *testing.T) { |
| 260 | t.Parallel() |
nothing calls this directly
no test coverage detected