From 68934a9b4d2aeebfcd26fa3dad6c983ba8d99d4e Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 27 Jul 2017 17:32:57 -0700 Subject: [PATCH] integration: test txn lease comparisons --- integration/v3_grpc_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/integration/v3_grpc_test.go b/integration/v3_grpc_test.go index ac9698ace8a7..78fb21d20d2a 100644 --- a/integration/v3_grpc_test.go +++ b/integration/v3_grpc_test.go @@ -564,6 +564,28 @@ func TestV3TxnRangeCompare(t *testing.T) { }, false, }, + { + // all keys are leased + pb.Compare{ + Key: []byte("/a/"), + RangeEnd: []byte("/a0"), + Target: pb.Compare_LEASE, + Result: pb.Compare_GREATER, + TargetUnion: &pb.Compare_Lease{0}, + }, + false, + }, + { + // no keys are leased + pb.Compare{ + Key: []byte("/a/"), + RangeEnd: []byte("/a0"), + Target: pb.Compare_LEASE, + Result: pb.Compare_EQUAL, + TargetUnion: &pb.Compare_Lease{0}, + }, + true, + }, } kvc := toGRPC(clus.Client(0)).KV