MCPcopy Create free account
hub / github.com/brimdata/super / TestPattern_Names

Function TestPattern_Names

pkg/grok/pattern_test.go:46–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

44}
45
46func TestPattern_Names(t *testing.T) {
47 h := New()
48 require.NoError(t, h.Add("ONE", `\d`))
49 require.NoError(t, h.Add("TWO", `%{ONE:one}-%{ONE:two}`))
50 require.NoError(t, h.Add("THREE", `%{ONE:zero}-%{TWO:three}`))
51 p, err := h.Get("THREE")
52 require.NoError(t, err)
53 require.Equal(t, []string{"zero", "three", "one", "two"}, p.Names())
54}
55
56func TestPattern_ParseKeyValues(t *testing.T) {
57 h := NewBase()

Callers

nothing calls this directly

Calls 5

NamesMethod · 0.80
NewFunction · 0.70
GetMethod · 0.65
AddMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected