TestFocusSessionUUIDCaseInsensitive verifies the UUID match is case-insensitive (matches the existing liveClaudeSessions normalization behavior).
(t *testing.T)
| 84 | // case-insensitive (matches the existing liveClaudeSessions |
| 85 | // normalization behavior). |
| 86 | func TestFocusSessionUUIDCaseInsensitive(t *testing.T) { |
| 87 | const uuid = "AAAAAAAA-BBBB-4CCC-8DDD-EEEEEEEEEEEE" |
| 88 | const psOutput = ` PID TTY COMMAND |
| 89 | 99999 ttys001 /usr/local/bin/claude --session-id aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee |
| 90 | ` |
| 91 | stubPS(t, psOutput, nil) |
| 92 | stubRunnerOutput(t, func(args []string) ([]byte, error) { |
| 93 | return []byte("ok"), nil |
| 94 | }) |
| 95 | focused, err := FocusSession(uuid, "claude") |
| 96 | if err != nil || !focused { |
| 97 | t.Errorf("uppercase UUID should match lowercase ps row; got (%v, %v)", focused, err) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | // TestFocusSessionNoMatchInPS returns (false, nil) without touching osascript. |
| 102 | func TestFocusSessionNoMatchInPS(t *testing.T) { |
nothing calls this directly
no test coverage detected