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

Function withDBOption

db_test.go:1443–1453  ·  view source on GitHub ↗
(t *testing.T, opt Options, fn func(t *testing.T, db *DB))

Source from the content-addressed store, hash-verified

1441}
1442
1443func withDBOption(t *testing.T, opt Options, fn func(t *testing.T, db *DB)) {
1444 db, err := Open(opt)
1445 require.NoError(t, err)
1446
1447 defer func() {
1448 _ = os.RemoveAll(db.opt.Dir)
1449 _ = db.Close()
1450 }()
1451
1452 fn(t, db)
1453}
1454
1455func withDefaultDB(t *testing.T, fn func(t *testing.T, db *DB)) {
1456 tmpdir, _ := os.MkdirTemp("", "nutsdb")

Callers 2

withDefaultDBFunction · 0.85
withRAMIdxDBFunction · 0.85

Calls 2

OpenFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected