MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / TestDB_Basic

Function TestDB_Basic

db_test.go:238–259  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

236}
237
238func TestDB_Basic(t *testing.T) {
239 runNutsDBTest(t, nil, func(t *testing.T, db *DB) {
240 bucket := "bucket"
241 txCreateBucket(t, db, DataStructureBTree, bucket, nil)
242 key0 := testutils.GetTestBytes(0)
243 val0 := testutils.GetRandomBytes(24)
244
245 // put
246 txPut(t, db, bucket, key0, val0, Persistent, nil, nil)
247 txGet(t, db, bucket, key0, val0, nil)
248
249 val1 := testutils.GetRandomBytes(24)
250
251 // update
252 txPut(t, db, bucket, key0, val1, Persistent, nil, nil)
253 txGet(t, db, bucket, key0, val1, nil)
254
255 // del
256 txDel(t, db, bucket, key0, nil)
257 txGet(t, db, bucket, key0, val1, ErrKeyNotFound)
258 })
259}
260
261func TestDB_ReopenWithDelete(t *testing.T) {
262 opts := &DefaultOptions

Callers

nothing calls this directly

Calls 7

GetTestBytesFunction · 0.92
GetRandomBytesFunction · 0.92
runNutsDBTestFunction · 0.85
txCreateBucketFunction · 0.85
txPutFunction · 0.85
txGetFunction · 0.85
txDelFunction · 0.85

Tested by

no test coverage detected