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

Function TestSchemaKey

x/keys_test.go:187–198  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

185}
186
187func TestSchemaKey(t *testing.T) {
188 for uid := range 1001 {
189 sattr := fmt.Sprintf("attr:%d", uid)
190
191 key := SchemaKey(AttrInRootNamespace(sattr))
192 pk, err := Parse(key)
193 require.NoError(t, err)
194
195 require.True(t, pk.IsSchema())
196 require.Equal(t, sattr, ParseAttr(pk.Attr))
197 }
198}
199
200func TestTypeKey(t *testing.T) {
201 for uid := range 1001 {

Callers

nothing calls this directly

Calls 5

SchemaKeyFunction · 0.85
AttrInRootNamespaceFunction · 0.85
ParseAttrFunction · 0.85
IsSchemaMethod · 0.80
ParseFunction · 0.70

Tested by

no test coverage detected