MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestSpawnTabLaunchEmptyOutput

Function TestSpawnTabLaunchEmptyOutput

internal/kitty/kitty_test.go:104–123  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

102// stdout, SpawnTab must fail rather than send-text to id:"" (which
103// kitty would interpret as match-all).
104func 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

Callers

nothing calls this directly

Calls 3

ErrorMethod · 0.80
stubRunnerOutputFunction · 0.70
SpawnTabFunction · 0.70

Tested by

no test coverage detected