@@ -53,19 +53,19 @@ func TestV2Set(t *testing.T) {
53
53
"/v2/keys/foo/bar" ,
54
54
v ,
55
55
http .StatusCreated ,
56
- `{"action":"set","node":{"key":"/foo/bar","value":"bar","modifiedIndex":4 ,"createdIndex":4 }}` ,
56
+ `{"action":"set","node":{"key":"/foo/bar","value":"bar","modifiedIndex":5 ,"createdIndex":5 }}` ,
57
57
},
58
58
{
59
59
"/v2/keys/foodir?dir=true" ,
60
60
url.Values {},
61
61
http .StatusCreated ,
62
- `{"action":"set","node":{"key":"/foodir","dir":true,"modifiedIndex":5 ,"createdIndex":5 }}` ,
62
+ `{"action":"set","node":{"key":"/foodir","dir":true,"modifiedIndex":6 ,"createdIndex":6 }}` ,
63
63
},
64
64
{
65
65
"/v2/keys/fooempty" ,
66
66
url .Values (map [string ][]string {"value" : {"" }}),
67
67
http .StatusCreated ,
68
- `{"action":"set","node":{"key":"/fooempty","value":"","modifiedIndex":6 ,"createdIndex":6 }}` ,
68
+ `{"action":"set","node":{"key":"/fooempty","value":"","modifiedIndex":7 ,"createdIndex":7 }}` ,
69
69
},
70
70
{
71
71
"/v2/keys/foo/novalue" ,
@@ -250,12 +250,12 @@ func TestV2CAS(t *testing.T) {
250
250
},
251
251
{
252
252
"/v2/keys/cas/foo" ,
253
- url .Values (map [string ][]string {"value" : {"YYY" }, "prevIndex" : {"4 " }}),
253
+ url .Values (map [string ][]string {"value" : {"YYY" }, "prevIndex" : {"5 " }}),
254
254
http .StatusOK ,
255
255
map [string ]interface {}{
256
256
"node" : map [string ]interface {}{
257
257
"value" : "YYY" ,
258
- "modifiedIndex" : float64 (5 ),
258
+ "modifiedIndex" : float64 (6 ),
259
259
},
260
260
"action" : "compareAndSwap" ,
261
261
},
@@ -267,8 +267,8 @@ func TestV2CAS(t *testing.T) {
267
267
map [string ]interface {}{
268
268
"errorCode" : float64 (101 ),
269
269
"message" : "Compare failed" ,
270
- "cause" : "[10 != 5 ]" ,
271
- "index" : float64 (5 ),
270
+ "cause" : "[10 != 6 ]" ,
271
+ "index" : float64 (6 ),
272
272
},
273
273
},
274
274
{
@@ -317,7 +317,7 @@ func TestV2CAS(t *testing.T) {
317
317
map [string ]interface {}{
318
318
"errorCode" : float64 (101 ),
319
319
"message" : "Compare failed" ,
320
- "cause" : "[bad_value != ZZZ] [100 != 6 ]" ,
320
+ "cause" : "[bad_value != ZZZ] [100 != 7 ]" ,
321
321
},
322
322
},
323
323
{
@@ -327,12 +327,12 @@ func TestV2CAS(t *testing.T) {
327
327
map [string ]interface {}{
328
328
"errorCode" : float64 (101 ),
329
329
"message" : "Compare failed" ,
330
- "cause" : "[100 != 6 ]" ,
330
+ "cause" : "[100 != 7 ]" ,
331
331
},
332
332
},
333
333
{
334
334
"/v2/keys/cas/foo" ,
335
- url .Values (map [string ][]string {"value" : {"XXX" }, "prevValue" : {"bad_value" }, "prevIndex" : {"6 " }}),
335
+ url .Values (map [string ][]string {"value" : {"XXX" }, "prevValue" : {"bad_value" }, "prevIndex" : {"7 " }}),
336
336
http .StatusPreconditionFailed ,
337
337
map [string ]interface {}{
338
338
"errorCode" : float64 (101 ),
@@ -342,7 +342,7 @@ func TestV2CAS(t *testing.T) {
342
342
},
343
343
{
344
344
"/v2/keys/cas/foo" ,
345
- url .Values (map [string ][]string {"value" : {"YYY" }, "prevIndex" : {"6 " }, "noValueOnSuccess" : {"true" }}),
345
+ url .Values (map [string ][]string {"value" : {"YYY" }, "prevIndex" : {"7 " }, "noValueOnSuccess" : {"true" }}),
346
346
http .StatusOK ,
347
347
map [string ]interface {}{
348
348
"action" : "compareAndSwap" ,
@@ -355,8 +355,8 @@ func TestV2CAS(t *testing.T) {
355
355
map [string ]interface {}{
356
356
"errorCode" : float64 (101 ),
357
357
"message" : "Compare failed" ,
358
- "cause" : "[10 != 7 ]" ,
359
- "index" : float64 (7 ),
358
+ "cause" : "[10 != 8 ]" ,
359
+ "index" : float64 (8 ),
360
360
},
361
361
},
362
362
}
@@ -509,7 +509,7 @@ func TestV2CAD(t *testing.T) {
509
509
map [string ]interface {}{
510
510
"errorCode" : float64 (101 ),
511
511
"message" : "Compare failed" ,
512
- "cause" : "[100 != 4 ]" ,
512
+ "cause" : "[100 != 5 ]" ,
513
513
},
514
514
},
515
515
{
@@ -521,12 +521,12 @@ func TestV2CAD(t *testing.T) {
521
521
},
522
522
},
523
523
{
524
- "/v2/keys/foo?prevIndex=4 " ,
524
+ "/v2/keys/foo?prevIndex=5 " ,
525
525
http .StatusOK ,
526
526
map [string ]interface {}{
527
527
"node" : map [string ]interface {}{
528
528
"key" : "/foo" ,
529
- "modifiedIndex" : float64 (6 ),
529
+ "modifiedIndex" : float64 (7 ),
530
530
},
531
531
"action" : "compareAndDelete" ,
532
532
},
@@ -554,7 +554,7 @@ func TestV2CAD(t *testing.T) {
554
554
map [string ]interface {}{
555
555
"node" : map [string ]interface {}{
556
556
"key" : "/foovalue" ,
557
- "modifiedIndex" : float64 (7 ),
557
+ "modifiedIndex" : float64 (8 ),
558
558
},
559
559
"action" : "compareAndDelete" ,
560
560
},
@@ -596,7 +596,7 @@ func TestV2Unique(t *testing.T) {
596
596
http .StatusCreated ,
597
597
map [string ]interface {}{
598
598
"node" : map [string ]interface {}{
599
- "key" : "/foo/00000000000000000004 " ,
599
+ "key" : "/foo/00000000000000000005 " ,
600
600
"value" : "XXX" ,
601
601
},
602
602
"action" : "create" ,
@@ -608,7 +608,7 @@ func TestV2Unique(t *testing.T) {
608
608
http .StatusCreated ,
609
609
map [string ]interface {}{
610
610
"node" : map [string ]interface {}{
611
- "key" : "/foo/00000000000000000005 " ,
611
+ "key" : "/foo/00000000000000000006 " ,
612
612
"value" : "XXX" ,
613
613
},
614
614
"action" : "create" ,
@@ -620,7 +620,7 @@ func TestV2Unique(t *testing.T) {
620
620
http .StatusCreated ,
621
621
map [string ]interface {}{
622
622
"node" : map [string ]interface {}{
623
- "key" : "/bar/00000000000000000006 " ,
623
+ "key" : "/bar/00000000000000000007 " ,
624
624
"value" : "XXX" ,
625
625
},
626
626
"action" : "create" ,
@@ -686,8 +686,8 @@ func TestV2Get(t *testing.T) {
686
686
map [string ]interface {}{
687
687
"key" : "/foo/bar" ,
688
688
"dir" : true ,
689
- "createdIndex" : float64 (4 ),
690
- "modifiedIndex" : float64 (4 ),
689
+ "createdIndex" : float64 (5 ),
690
+ "modifiedIndex" : float64 (5 ),
691
691
},
692
692
},
693
693
},
@@ -705,14 +705,14 @@ func TestV2Get(t *testing.T) {
705
705
map [string ]interface {}{
706
706
"key" : "/foo/bar" ,
707
707
"dir" : true ,
708
- "createdIndex" : float64 (4 ),
709
- "modifiedIndex" : float64 (4 ),
708
+ "createdIndex" : float64 (5 ),
709
+ "modifiedIndex" : float64 (5 ),
710
710
"nodes" : []interface {}{
711
711
map [string ]interface {}{
712
712
"key" : "/foo/bar/zar" ,
713
713
"value" : "XXX" ,
714
- "createdIndex" : float64 (4 ),
715
- "modifiedIndex" : float64 (4 ),
714
+ "createdIndex" : float64 (5 ),
715
+ "modifiedIndex" : float64 (5 ),
716
716
},
717
717
},
718
718
},
@@ -784,8 +784,8 @@ func TestV2QuorumGet(t *testing.T) {
784
784
map [string ]interface {}{
785
785
"key" : "/foo/bar" ,
786
786
"dir" : true ,
787
- "createdIndex" : float64 (4 ),
788
- "modifiedIndex" : float64 (4 ),
787
+ "createdIndex" : float64 (5 ),
788
+ "modifiedIndex" : float64 (5 ),
789
789
},
790
790
},
791
791
},
@@ -803,14 +803,14 @@ func TestV2QuorumGet(t *testing.T) {
803
803
map [string ]interface {}{
804
804
"key" : "/foo/bar" ,
805
805
"dir" : true ,
806
- "createdIndex" : float64 (4 ),
807
- "modifiedIndex" : float64 (4 ),
806
+ "createdIndex" : float64 (5 ),
807
+ "modifiedIndex" : float64 (5 ),
808
808
"nodes" : []interface {}{
809
809
map [string ]interface {}{
810
810
"key" : "/foo/bar/zar" ,
811
811
"value" : "XXX" ,
812
- "createdIndex" : float64 (4 ),
813
- "modifiedIndex" : float64 (4 ),
812
+ "createdIndex" : float64 (5 ),
813
+ "modifiedIndex" : float64 (5 ),
814
814
},
815
815
},
816
816
},
@@ -866,7 +866,7 @@ func TestV2Watch(t *testing.T) {
866
866
"node" : map [string ]interface {}{
867
867
"key" : "/foo/bar" ,
868
868
"value" : "XXX" ,
869
- "modifiedIndex" : float64 (4 ),
869
+ "modifiedIndex" : float64 (5 ),
870
870
},
871
871
"action" : "set" ,
872
872
}
@@ -888,7 +888,7 @@ func TestV2WatchWithIndex(t *testing.T) {
888
888
var body map [string ]interface {}
889
889
c := make (chan bool , 1 )
890
890
go func () {
891
- resp , err := tc .Get (fmt .Sprintf ("%s%s" , u , "/v2/keys/foo/bar?wait=true&waitIndex=5 " ))
891
+ resp , err := tc .Get (fmt .Sprintf ("%s%s" , u , "/v2/keys/foo/bar?wait=true&waitIndex=6 " ))
892
892
if err != nil {
893
893
t .Errorf ("watch err = %v, want nil" , err )
894
894
}
@@ -934,7 +934,7 @@ func TestV2WatchWithIndex(t *testing.T) {
934
934
"node" : map [string ]interface {}{
935
935
"key" : "/foo/bar" ,
936
936
"value" : "XXX" ,
937
- "modifiedIndex" : float64 (5 ),
937
+ "modifiedIndex" : float64 (6 ),
938
938
},
939
939
"action" : "set" ,
940
940
}
0 commit comments