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

Function TestIndexKey

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

Source from the content-addressed store, hash-verified

81}
82
83func TestIndexKey(t *testing.T) {
84 for uid := range 1001 {
85 sattr := fmt.Sprintf("attr:%d", uid)
86 sterm := fmt.Sprintf("term:%d", uid)
87
88 key := IndexKey(AttrInRootNamespace(sattr), sterm)
89 pk, err := Parse(key)
90 require.NoError(t, err)
91
92 require.True(t, pk.IsIndex())
93 require.Equal(t, sattr, ParseAttr(pk.Attr))
94 require.Equal(t, sterm, pk.Term)
95 }
96}
97
98func TestIndexKeyWithStartUid(t *testing.T) {
99 startUid := uint64(math.MaxUint64)

Callers

nothing calls this directly

Calls 5

IndexKeyFunction · 0.85
AttrInRootNamespaceFunction · 0.85
ParseAttrFunction · 0.85
IsIndexMethod · 0.80
ParseFunction · 0.70

Tested by

no test coverage detected