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

Function TestDB_Close

engine/db_test.go:394–408  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

392}
393
394func TestDB_Close(t *testing.T) {
395 opts := config.DefaultOptions
396 dir, _ := os.MkdirTemp("", "flydb-close")
397 opts.DirPath = dir
398 opts.DataFileSize = 64 * 1024 * 1024
399 db, err := NewDB(opts)
400 assert.Nil(t, err)
401 assert.NotNil(t, db)
402
403 err = db.Put(randkv.GetTestKey(10), randkv.GetTestKey(10))
404 assert.Nil(t, err)
405
406 err = db.Close()
407 assert.Nil(t, err)
408}
409
410func TestDB_Sync(t *testing.T) {
411 opts := config.DefaultOptions

Callers

nothing calls this directly

Calls 4

PutMethod · 0.95
CloseMethod · 0.95
GetTestKeyFunction · 0.92
NewDBFunction · 0.85

Tested by

no test coverage detected