(t *testing.T, opt Options, fn func(t *testing.T, db *DB))
| 1441 | } |
| 1442 | |
| 1443 | func 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 | |
| 1455 | func withDefaultDB(t *testing.T, fn func(t *testing.T, db *DB)) { |
| 1456 | tmpdir, _ := os.MkdirTemp("", "nutsdb") |
no test coverage detected