TestSpawnTabLaunchEmptyOutput — if kitty @ launch returns empty stdout, SpawnTab must fail rather than send-text to id:"" (which kitty would interpret as match-all).
(t *testing.T)
| 102 | // stdout, SpawnTab must fail rather than send-text to id:"" (which |
| 103 | // kitty would interpret as match-all). |
| 104 | func TestSpawnTabLaunchEmptyOutput(t *testing.T) { |
| 105 | stubRunnerOutput(t, func(args []string) ([]byte, error) { |
| 106 | return []byte("\n"), nil |
| 107 | }) |
| 108 | runnerCalled := false |
| 109 | old := Runner |
| 110 | Runner = func(args []string) error { |
| 111 | runnerCalled = true |
| 112 | return nil |
| 113 | } |
| 114 | t.Cleanup(func() { Runner = old }) |
| 115 | |
| 116 | err := SpawnTab("t", "/tmp", "echo hi", nil) |
| 117 | if err == nil { |
| 118 | t.Fatal("expected error, got nil") |
| 119 | } |
| 120 | if runnerCalled { |
| 121 | t.Error("Runner (send-text) should not be called when launch returns empty id") |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | // TestSpawnTabFlattensEmbeddedNewlines — embedded `\n` in command must |
| 126 | // be replaced with a space before send-text, same reasoning as zellij |
nothing calls this directly
no test coverage detected