(t *testing.T)
| 19 | import "testing" |
| 20 | |
| 21 | func TestNormalizeTemplatePathWindows(t *testing.T) { |
| 22 | tests := []struct { |
| 23 | name string |
| 24 | input string |
| 25 | want string |
| 26 | }{ |
| 27 | {"backslash", "templates\\file.yaml", "templates/file.yaml"}, |
| 28 | {"nested backslash", "templates\\nested\\file.yaml", "templates/nested/file.yaml"}, |
| 29 | {"mixed slashes", "templates\\nested/file.yaml", "templates/nested/file.yaml"}, |
| 30 | {"trailing backslash", "templates\\", "templates/"}, |
| 31 | } |
| 32 | |
| 33 | for _, tt := range tests { |
| 34 | t.Run(tt.name, func(t *testing.T) { |
| 35 | if got := NormalizeTemplatePath(tt.input); got != tt.want { |
| 36 | t.Errorf("NormalizeTemplatePath(%q) = %q, want %q", tt.input, got, tt.want) |
| 37 | } |
| 38 | }) |
| 39 | } |
| 40 | } |
nothing calls this directly
no test coverage detected