From b59c9936818fc015d45c6d6f3215e000b36c00b4 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Thu, 31 Dec 2015 19:27:26 -0800 Subject: [PATCH] storage: kv_test.go events slice --- storage/kv_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/storage/kv_test.go b/storage/kv_test.go index 80b3ec129..0d419f4d1 100644 --- a/storage/kv_test.go +++ b/storage/kv_test.go @@ -740,7 +740,7 @@ func TestWatchableKVWatch(t *testing.T) { s.Put([]byte("foo"), []byte("bar")) select { - case ev := <-w.Chan(): + case evs := <-w.Chan(): wev := storagepb.Event{ Type: storagepb.PUT, Kv: &storagepb.KeyValue{ @@ -752,6 +752,7 @@ func TestWatchableKVWatch(t *testing.T) { }, WatchID: wid, } + ev := evs[0] if !reflect.DeepEqual(ev, wev) { t.Errorf("watched event = %+v, want %+v", ev, wev) } @@ -761,7 +762,7 @@ func TestWatchableKVWatch(t *testing.T) { s.Put([]byte("foo1"), []byte("bar1")) select { - case ev := <-w.Chan(): + case evs := <-w.Chan(): wev := storagepb.Event{ Type: storagepb.PUT, Kv: &storagepb.KeyValue{ @@ -773,6 +774,7 @@ func TestWatchableKVWatch(t *testing.T) { }, WatchID: wid, } + ev := evs[0] if !reflect.DeepEqual(ev, wev) { t.Errorf("watched event = %+v, want %+v", ev, wev) } @@ -787,7 +789,7 @@ func TestWatchableKVWatch(t *testing.T) { defer cancel() select { - case ev := <-w.Chan(): + case evs := <-w.Chan(): wev := storagepb.Event{ Type: storagepb.PUT, Kv: &storagepb.KeyValue{ @@ -799,6 +801,7 @@ func TestWatchableKVWatch(t *testing.T) { }, WatchID: wid, } + ev := evs[0] if !reflect.DeepEqual(ev, wev) { t.Errorf("watched event = %+v, want %+v", ev, wev) } @@ -808,7 +811,7 @@ func TestWatchableKVWatch(t *testing.T) { s.Put([]byte("foo1"), []byte("bar11")) select { - case ev := <-w.Chan(): + case evs := <-w.Chan(): wev := storagepb.Event{ Type: storagepb.PUT, Kv: &storagepb.KeyValue{ @@ -820,6 +823,7 @@ func TestWatchableKVWatch(t *testing.T) { }, WatchID: wid, } + ev := evs[0] if !reflect.DeepEqual(ev, wev) { t.Errorf("watched event = %+v, want %+v", ev, wev) }