(t *testing.T)
| 372 | } |
| 373 | |
| 374 | func TestNormalizeTemplatePath(t *testing.T) { |
| 375 | tests := []struct { |
| 376 | name string |
| 377 | input string |
| 378 | want string |
| 379 | }{ |
| 380 | {"unix path", "templates/file.yaml", "templates/file.yaml"}, |
| 381 | {"nested path", "templates/nested/file.yaml", "templates/nested/file.yaml"}, |
| 382 | {"simple file", "file.yaml", "file.yaml"}, |
| 383 | {"empty string", "", ""}, |
| 384 | {"trailing slash", "templates/", "templates/"}, |
| 385 | } |
| 386 | |
| 387 | for _, tt := range tests { |
| 388 | t.Run(tt.name, func(t *testing.T) { |
| 389 | if got := NormalizeTemplatePath(tt.input); got != tt.want { |
| 390 | t.Errorf("NormalizeTemplatePath(%q) = %q, want %q", tt.input, got, tt.want) |
| 391 | } |
| 392 | }) |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | // TestIsPrimitiveSlice_NarrowIntegerWidths pins that all Go integer |
| 397 | // widths plus floats/bools/strings/nil count as primitive. yaml.v3 |
nothing calls this directly
no test coverage detected