Files
wehub-resource-sync ead81af521
Deploy to GitHub Pages / deploy (push) Failing after 0s
CI / go (push) Has been cancelled
CI / build (darwin, macos-14) (push) Has been cancelled
CI / build (windows, windows-2025) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:31:13 +08:00

24 lines
466 B
Go

package cmd
import "testing"
func TestShellQuote(t *testing.T) {
tests := []struct {
input, want string
}{
{"simple", "'simple'"},
{"with space", "'with space'"},
{"it's", `'it'\''s'`},
{"", "''"},
{"a'b'c", `'a'\''b'\''c'`},
{`back\slash`, `'back\slash'`},
{`"double"`, `'"double"'`},
}
for _, tt := range tests {
got := shellQuote(tt.input)
if got != tt.want {
t.Errorf("shellQuote(%q) = %q, want %q", tt.input, got, tt.want)
}
}
}