MCPcopy Index your code
hub / github.com/celer-pkg/celer / TestShellQuote

Function TestShellQuote

pkgcache/cache_setup_test.go:65–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

63}
64
65func TestShellQuote(t *testing.T) {
66 tests := []struct {
67 value string
68 want string
69 }{
70 {value: "/srv/cache", want: "'/srv/cache'"},
71 {value: "/srv/celer cache", want: "'/srv/celer cache'"},
72 {value: "/srv/celer's cache", want: "'/srv/celer'\\''s cache'"},
73 }
74
75 for _, tt := range tests {
76 t.Run(tt.value, func(t *testing.T) {
77 if got := shellQuote(tt.value); got != tt.want {
78 t.Fatalf("shellQuote(%q) = %q, want %q", tt.value, got, tt.want)
79 }
80 })
81 }
82}
83
84func TestNFSServerSetupRemoveNFSExportEntry(t *testing.T) {
85 exportsPath := filepath.Join(t.TempDir(), "exports")

Callers

nothing calls this directly

Calls 1

shellQuoteFunction · 0.85

Tested by

no test coverage detected