...
1
16
17 package strings
18
19 import (
20 "testing"
21 )
22
23 func TestEscapeQualifiedNameForDisk(t *testing.T) {
24 testCases := []struct {
25 input string
26 output string
27 }{
28 {"kubernetes.io/blah", "kubernetes.io~blah"},
29 {"blah/blerg/borg", "blah~blerg~borg"},
30 {"kubernetes.io", "kubernetes.io"},
31 }
32 for i, tc := range testCases {
33 escapee := EscapeQualifiedName(tc.input)
34 if escapee != tc.output {
35 t.Errorf("case[%d]: expected (%q), got (%q)", i, tc.output, escapee)
36 }
37 original := UnescapeQualifiedName(escapee)
38 if original != tc.input {
39 t.Errorf("case[%d]: expected (%q), got (%q)", i, tc.input, original)
40 }
41 }
42 }
43
View as plain text