Skip to content

Commit

Permalink
integration: test Put with PrevKey=true
Browse files Browse the repository at this point in the history
Was missing in proxy.
  • Loading branch information
Anthony Romano authored and visheshnp committed Aug 4, 2017
1 parent b925f00 commit 70dbf27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion integration/v3_grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestV3PutOverwrite(t *testing.T) {

kvc := toGRPC(clus.RandClient()).KV
key := []byte("foo")
reqput := &pb.PutRequest{Key: key, Value: []byte("bar")}
reqput := &pb.PutRequest{Key: key, Value: []byte("bar"), PrevKv: true}

respput, err := kvc.Put(context.TODO(), reqput)
if err != nil {
Expand All @@ -61,6 +61,9 @@ func TestV3PutOverwrite(t *testing.T) {
t.Fatalf("expected newer revision on overwrite, got %v <= %v",
respput2.Header.Revision, respput.Header.Revision)
}
if pkv := respput2.PrevKv; pkv == nil || string(pkv.Value) != "bar" {
t.Fatalf("expected PrevKv=bar, got response %+v", respput2)
}

reqrange := &pb.RangeRequest{Key: key}
resprange, err := kvc.Range(context.TODO(), reqrange)
Expand Down

0 comments on commit 70dbf27

Please sign in to comment.