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

Function TestCountKeyWithStartUid

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

Source from the content-addressed store, hash-verified

166}
167
168func TestCountKeyWithStartUid(t *testing.T) {
169 startUid := uint64(math.MaxUint64)
170 for count := range uint32(1001) {
171 sattr := fmt.Sprintf("attr:%d", count)
172
173 key := CountKey(AttrInRootNamespace(sattr), count, true)
174 key, err := SplitKey(key, startUid)
175 require.NoError(t, err)
176 pk, err := Parse(key)
177 require.NoError(t, err)
178
179 require.True(t, pk.IsCountOrCountRev())
180 require.Equal(t, sattr, ParseAttr(pk.Attr))
181 require.Equal(t, count, pk.Count)
182 require.Equal(t, pk.HasStartUid, true)
183 require.Equal(t, startUid, pk.StartUid)
184 }
185}
186
187func TestSchemaKey(t *testing.T) {
188 for uid := range 1001 {

Callers

nothing calls this directly

Calls 6

CountKeyFunction · 0.85
AttrInRootNamespaceFunction · 0.85
SplitKeyFunction · 0.85
ParseAttrFunction · 0.85
IsCountOrCountRevMethod · 0.80
ParseFunction · 0.70

Tested by

no test coverage detected