From 633a0bdf5562e4cef05c7573adebbb58c0be81fd Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Sat, 5 Mar 2016 18:52:41 -0800 Subject: [PATCH] integration: add test for full range watching --- integration/v3_watch_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/integration/v3_watch_test.go b/integration/v3_watch_test.go index 16ae7dcc9..7a0e123df 100644 --- a/integration/v3_watch_test.go +++ b/integration/v3_watch_test.go @@ -98,6 +98,27 @@ func TestV3WatchFromCurrentRevision(t *testing.T) { []*pb.WatchResponse{}, }, + // watch full range, matching + { + []string{"fooLong"}, + &pb.WatchRequest{RequestUnion: &pb.WatchRequest_CreateRequest{ + CreateRequest: &pb.WatchCreateRequest{ + Key: []byte(""), + RangeEnd: []byte("\x00")}}}, + + []*pb.WatchResponse{ + { + Header: &pb.ResponseHeader{Revision: 2}, + Created: false, + Events: []*storagepb.Event{ + { + Type: storagepb.PUT, + Kv: &storagepb.KeyValue{Key: []byte("fooLong"), Value: []byte("bar"), CreateRevision: 2, ModRevision: 2, Version: 1}, + }, + }, + }, + }, + }, // multiple puts, one watcher with matching key { []string{"foo", "foo", "foo"},