MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / TestHashStructure_HExists

Function TestHashStructure_HExists

structure/hash_test.go:115–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestHashStructure_HExists(t *testing.T) {
116 hash, _ := initHashDB()
117 defer hash.db.Clean()
118
119 ok1, err := hash.HSet("1", []byte("field1"), randkv.RandomValue(100))
120 assert.Nil(t, err)
121 assert.True(t, ok1)
122
123 ok2, err := hash.HExists("1", []byte("field1"))
124 assert.Nil(t, err)
125 assert.True(t, ok2)
126
127 ok3, err := hash.HExists("1", []byte("field2"))
128 assert.Nil(t, err)
129 assert.False(t, ok3)
130
131}
132
133func TestHashStructure_HLen(t *testing.T) {
134 hash, _ := initHashDB()

Callers

nothing calls this directly

Calls 5

RandomValueFunction · 0.92
initHashDBFunction · 0.85
HSetMethod · 0.65
HExistsMethod · 0.65
CleanMethod · 0.45

Tested by

no test coverage detected