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

Function TestShellQuoteParity

internal/spawner/spawner_test.go:457–477  ·  view source on GitHub ↗

TestShellQuoteParity makes sure the re-exported helper matches every backend's implementation. All backends quote identically.

(t *testing.T)

Source from the content-addressed store, hash-verified

455// TestShellQuoteParity makes sure the re-exported helper matches
456// every backend's implementation. All backends quote identically.
457func TestShellQuoteParity(t *testing.T) {
458 cases := []string{"plain", "with space", "with'quote", `back\slash`, ""}
459 for _, in := range cases {
460 exp := iterm.ShellQuote(in)
461 if got := ShellQuote(in); got != exp {
462 t.Errorf("spawner.ShellQuote(%q) = %q; want %q", in, got, exp)
463 }
464 if got := terminal.ShellQuote(in); got != exp {
465 t.Errorf("terminal.ShellQuote(%q) = %q; want %q", in, got, exp)
466 }
467 if got := zellij.ShellQuote(in); got != exp {
468 t.Errorf("zellij.ShellQuote(%q) = %q; want %q", in, got, exp)
469 }
470 if got := warp.ShellQuote(in); got != exp {
471 t.Errorf("warp.ShellQuote(%q) = %q; want %q", in, got, exp)
472 }
473 if got := ghostty.ShellQuote(in); got != exp {
474 t.Errorf("ghostty.ShellQuote(%q) = %q; want %q", in, got, exp)
475 }
476 }
477}
478
479// runnerFlags bundles per-backend "was called" flags so routing tests
480// can assert on which backend SpawnTab dispatched to without an

Callers

nothing calls this directly

Calls 6

ShellQuoteFunction · 0.92
ShellQuoteFunction · 0.92
ShellQuoteFunction · 0.92
ShellQuoteFunction · 0.92
ShellQuoteFunction · 0.92
ShellQuoteFunction · 0.70

Tested by

no test coverage detected