From 20be8c75e53523b022f22e4e306ba8a4da034e80 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Tue, 8 May 2018 17:13:13 +0200 Subject: [PATCH] Tweak testcases --- remotedb/remotedb_test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/remotedb/remotedb_test.go b/remotedb/remotedb_test.go index 6bc0c77bd..cbe9d9095 100644 --- a/remotedb/remotedb_test.go +++ b/remotedb/remotedb_test.go @@ -47,7 +47,9 @@ func TestRemoteDB(t *testing.T) { // Set some more keys k2 := []byte("key-2") v2 := []byte("value-2") - client.Set(k2, v2) + client.SetSync(k2, v2) + has := client.Has(k2) + require.True(t, has) gv2 := client.Get(k2) require.Equal(t, gv2, v2) @@ -64,7 +66,7 @@ func TestRemoteDB(t *testing.T) { // Deletion client.Delete(k1) - client.Delete(k2) + client.DeleteSync(k2) gv1 = client.Get(k1) gv2 = client.Get(k2) require.Equal(t, len(gv2), 0, "after deletion, not expecting the key to exist anymore") @@ -90,16 +92,24 @@ func TestRemoteDB(t *testing.T) { rv4 = client.Get(k4) require.Equal(t, rv4, v4, "expecting k4 to have been stored") - // Batch tests - set and delete + // Batch tests - deletion bat = client.NewBatch() bat.Delete(k4) - bat.Set(k5, v5) bat.Delete(k3) bat.WriteSync() rv3 = client.Get(k3) require.Equal(t, 0, len(rv3), "expecting k3 to have been deleted") rv4 = client.Get(k4) require.Equal(t, 0, len(rv4), "expecting k4 to have been deleted") + + // Batch tests - set and delete + bat = client.NewBatch() + bat.Set(k4, v4) + bat.Set(k5, v5) + bat.Delete(k4) + bat.WriteSync() + rv4 = client.Get(k4) + require.Equal(t, 0, len(rv4), "expecting k4 to have been deleted") rv5 := client.Get(k5) require.Equal(t, rv5, v5, "expecting k5 to have been stored") }