MCPcopy
hub / github.com/dgraph-io/dgraph / checkSchema

Function checkSchema

schema/parse_test.go:26–36  ·  view source on GitHub ↗
(t *testing.T, h map[string]*pb.SchemaUpdate, expected []nameType)

Source from the content-addressed store, hash-verified

24}
25
26func checkSchema(t *testing.T, h map[string]*pb.SchemaUpdate, expected []nameType) {
27 if len(h) != len(expected) {
28 t.Errorf("In checkSchema, expected len(h) == len(expected)")
29 }
30 require.Len(t, h, len(expected))
31 for _, nt := range expected {
32 typ, found := h[nt.name]
33 require.True(t, found, nt)
34 require.EqualValuesf(t, *nt.typ, *typ, "found in map: %+v\n expected: %+v", *typ, *nt.typ)
35 }
36}
37
38var schemaVal = `
39age:int .

Callers 2

TestSchemaFunction · 0.70
TestSchemaIndexCustomFunction · 0.70

Calls 2

LenMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected