INNER CODE UNIT · Go
TestNil
philippgille/gokv · badgerdb/badgerdb_test.go:81
func TestNil(t *testing.T) {
// Test setting nil
t.Run("set nil with JSON marshalling", func(t *testing.T) {
store, path := createStore(t, encoding.JSON)
defer cleanUp(store, path)
err := store.Set("foo", nil)
if err == nil {
t.Error("Expected an error")
}
})
t.Run("set nil with Gob marshalling", func(t *testing.T) {
store, path := createStore(t, encoding.Gob)
defer cleanUp(store, path)
err := store.Set("foo", nil)
if err == nil {
t.Error("Expected an error")