MCPcopy Create free account
hub / github.com/cozystack/talm / TestNormalizeTemplatePath

Function TestNormalizeTemplatePath

pkg/engine/engine_test.go:374–394  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

372}
373
374func 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

Callers

nothing calls this directly

Calls 1

NormalizeTemplatePathFunction · 0.85

Tested by

no test coverage detected