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

Function TestDuplicates

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

Source from the content-addressed store, hash-verified

92}
93
94func TestDuplicates(t *testing.T) {
95 ctx := super.NewContext()
96 setType := ctx.LookupTypeSet(super.TypeInt32)
97 typ1, err := ctx.LookupTypeRecord([]super.Field{
98 {"a", super.TypeString, false},
99 {"b", setType, false},
100 })
101 require.NoError(t, err)
102 typ2, err := sup.ParseType(ctx, "{a:string,b:|[int32]|}")
103 require.NoError(t, err)
104 assert.EqualValues(t, typ1.ID(), typ2.ID())
105 assert.EqualValues(t, setType.ID(), typ2.(*super.TypeRecord).Fields[1].Type.ID())
106 typ3, err := ctx.LookupByValue(super.EncodeTypeValue(setType))
107 require.NoError(t, err)
108 assert.Equal(t, setType.ID(), typ3.ID())
109}
110
111func TestTranslateNamed(t *testing.T) {
112 c1 := super.NewContext()

Callers

nothing calls this directly

Calls 8

LookupTypeSetMethod · 0.95
LookupTypeRecordMethod · 0.95
LookupByValueMethod · 0.95
NewContextFunction · 0.92
ParseTypeFunction · 0.92
EncodeTypeValueFunction · 0.92
IDMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected