MCPcopy Index your code
hub / github.com/cortexproject/cortex / Test_SetConfig_ValidateTemplateFiles

Function Test_SetConfig_ValidateTemplateFiles

pkg/configs/api/api_test.go:378–398  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

376}
377
378func Test_SetConfig_ValidateTemplateFiles(t *testing.T) {
379 cfg := userconfig.Config{
380 TemplateFiles: map[string]string{
381 "mytemplate.tmpl": `
382 {{ define "mytemplate" }}
383 ToUpper{{ .Value | toUpper }}
384 ToLower{{ .Value | toLower }}
385 Title{{ .Value | title }}
386 Join{{ .Values | join " " }}
387 Match{{ .Value | match "fir" }}
388 SafeHTML{{ .Value | safeHtml }}
389 ReReplaceAll{{ .Value | reReplaceAll "-" "_" }}
390 StringSlice{{ .Value | stringSlice }}
391 {{ end }}
392 `,
393 },
394 }
395
396 err := validateTemplateFiles(cfg)
397 assert.Equal(t, nil, err)
398}

Callers

nothing calls this directly

Calls 2

validateTemplateFilesFunction · 0.85
EqualMethod · 0.65

Tested by

no test coverage detected