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

Function TestRecordAccessNamed

complex_test.go:16–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestRecordAccessNamed(t *testing.T) {
17 const input = `{foo:"hello"::=zfile,bar:true::=zbool}::=0`
18 rec := sup.MustParseValue(super.NewContext(), input)
19 s := rec.Deref("foo").AsString()
20 assert.Equal(t, s, "hello")
21 b := rec.Deref("bar").AsBool()
22 assert.Equal(t, b, true)
23}
24
25func TestNonRecordDeref(t *testing.T) {
26 const input = `

Callers

nothing calls this directly

Calls 6

MustParseValueFunction · 0.92
NewContextFunction · 0.92
AsStringMethod · 0.80
AsBoolMethod · 0.80
DerefMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected