MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / TestTemplateSyntaxError

Function TestTemplateSyntaxError

pkg/event/formatter_test.go:47–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestTemplateSyntaxError(t *testing.T) {
48 template := "{{ .Seq }} {{.CPU}} {.Type}}"
49 _, err := NewFormatter(template)
50 require.Error(t, err, "template syntax error near field #3: {{ .Seq }} {{.CPU}} {.Type}}")
51}
52
53func TestFormat(t *testing.T) {
54 template := "{{ .Seq }} {{.CPU}} - ({{.Type}}) -- pid: {{ .Params.Pid }} ({{.Params}}) {{ .Meta }}"

Callers

nothing calls this directly

Calls 2

NewFormatterFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected