INNER CODE UNIT · Go

TestErrors

philippgille/gokv · badgerdb/badgerdb_test.go:62

func TestErrors(t *testing.T) {
	// Test empty key
	store, path := createStore(t, encoding.JSON)
	defer cleanUp(store, path)
	err := store.Set("", "bar")
	if err == nil {
		t.Error("Expected an error")
	}
	_, err = store.Get("", new(string))
	if err == nil {
		t.Error("Expected an error")
	}
	err = store.Delete("")
	if err == nil {
		t.Error("Expected an error")
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…