INNER CODE UNIT · Go

TestClose

philippgille/gokv · badgerdb/badgerdb_test.go:138

func TestClose(t *testing.T) {
	store, path := createStore(t, encoding.JSON)
	defer func() { _ = os.RemoveAll(path) }()
	err := store.Close()
	if err != nil {
		t.Error(err)
	}
}

// TestNonExistingDir tests whether the implementation can create the given directory on its own.
// When using BadgerDB directly, it requires the given path to exist and to be writeable.
func TestNonExistingDir(t *testing.T) {
	tmpDir := os.TempDir() + "/BadgerDB"
	err := os.RemoveAll(tmpDir)
	if err != nil {
		t.Fatal(err)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…