TestShellQuote is a sanity check on the local helper — same contract as iterm.ShellQuote and terminal.ShellQuote.
(t *testing.T)
| 81 | // TestShellQuote is a sanity check on the local helper — same contract |
| 82 | // as iterm.ShellQuote and terminal.ShellQuote. |
| 83 | func TestShellQuote(t *testing.T) { |
| 84 | cases := []struct { |
| 85 | in, want string |
| 86 | }{ |
| 87 | {"plain", "'plain'"}, |
| 88 | {"with space", "'with space'"}, |
| 89 | {"with'quote", `'with'\''quote'`}, |
| 90 | } |
| 91 | for _, tc := range cases { |
| 92 | if got := ShellQuote(tc.in); got != tc.want { |
| 93 | t.Errorf("ShellQuote(%q) = %q; want %q", tc.in, got, tc.want) |
| 94 | } |
| 95 | } |
| 96 | } |
nothing calls this directly
no test coverage detected