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

Function TestCountKey

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

Source from the content-addressed store, hash-verified

151}
152
153func TestCountKey(t *testing.T) {
154
155 for count := range uint32(1001) {
156 sattr := fmt.Sprintf("attr:%d", count)
157
158 key := CountKey(AttrInRootNamespace(sattr), count, true)
159 pk, err := Parse(key)
160 require.NoError(t, err)
161
162 require.True(t, pk.IsCountOrCountRev())
163 require.Equal(t, sattr, ParseAttr(pk.Attr))
164 require.Equal(t, count, pk.Count)
165 }
166}
167
168func TestCountKeyWithStartUid(t *testing.T) {
169 startUid := uint64(math.MaxUint64)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected