refactor change Index to modifiedIndex

This commit is contained in:
Xiang Li
2013-11-09 20:49:19 -08:00
parent d8e5994c35
commit 06f1b7f2e8
11 changed files with 50 additions and 44 deletions

View File

@@ -22,7 +22,7 @@ func TestV2SetKey(t *testing.T) {
resp, err := tests.PutForm(fmt.Sprintf("http://%s%s", s.URL(), "/v2/keys/foo/bar"), v)
body := tests.ReadBody(resp)
assert.Nil(t, err, "")
assert.Equal(t, string(body), `{"action":"set","key":"/foo/bar","value":"XXX","index":1}`, "")
assert.Equal(t, string(body), `{"action":"set","key":"/foo/bar","value":"XXX","modifiedIndex":1}`, "")
})
}
@@ -175,7 +175,7 @@ func TestV2SetKeyCASOnIndexSuccess(t *testing.T) {
assert.Equal(t, body["action"], "compareAndSwap", "")
assert.Equal(t, body["prevValue"], "XXX", "")
assert.Equal(t, body["value"], "YYY", "")
assert.Equal(t, body["index"], 2, "")
assert.Equal(t, body["modifiedIndex"], 2, "")
})
}
@@ -236,7 +236,7 @@ func TestV2SetKeyCASOnValueSuccess(t *testing.T) {
assert.Equal(t, body["action"], "compareAndSwap", "")
assert.Equal(t, body["prevValue"], "XXX", "")
assert.Equal(t, body["value"], "YYY", "")
assert.Equal(t, body["index"], 2, "")
assert.Equal(t, body["modifiedIndex"], 2, "")
})
}