cleanup after tests!

This commit is contained in:
Anton Kaliaev
2018-09-18 12:15:44 +04:00
parent 76302c651f
commit 747797bf3b
6 changed files with 41 additions and 16 deletions
+2 -3
View File
@@ -60,11 +60,10 @@ func checkValuePanics(t *testing.T, itr Iterator) {
assert.Panics(t, func() { itr.Key() }, "checkValuePanics expected panic but didn't")
}
func newTempDB(t *testing.T, backend DBBackendType) (db DB) {
func newTempDB(t *testing.T, backend DBBackendType) (db DB, dbDir string) {
dirname, err := ioutil.TempDir("", "db_common_test")
require.Nil(t, err)
db = NewDB("testdb", backend, dirname)
return db
return NewDB("testdb", backend, dirname), dirname
}
//----------------------------------------