mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
e2e: add quoted key/value to txn test
This commit is contained in:
parent
3faff8b2e2
commit
09a239f040
@ -39,15 +39,23 @@ func txnTestSuccess(cx ctlCtx) {
|
|||||||
if err := ctlV3Put(cx, "key2", "value2", ""); err != nil {
|
if err := ctlV3Put(cx, "key2", "value2", ""); err != nil {
|
||||||
cx.t.Fatalf("txnTestSuccess ctlV3Put error (%v)", err)
|
cx.t.Fatalf("txnTestSuccess ctlV3Put error (%v)", err)
|
||||||
}
|
}
|
||||||
|
rqs := []txnRequests{
|
||||||
rqs := txnRequests{
|
{
|
||||||
compare: []string{`version("key1") = "1"`, `version("key2") = "1"`},
|
compare: []string{`version("key1") = "1"`, `version("key2") = "1"`},
|
||||||
ifSucess: []string{"get key1", "get key2"},
|
ifSucess: []string{"get key1", "get key2", `put "key \"with\" space" "value \x23"`},
|
||||||
ifFail: []string{`put key1 "fail"`, `put key2 "fail"`},
|
ifFail: []string{`put key1 "fail"`, `put key2 "fail"`},
|
||||||
results: []string{"SUCCESS", "key1", "value1", "key2", "value2"},
|
results: []string{"SUCCESS", "key1", "value1", "key2", "value2"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
compare: []string{`version("key \"with\" space") = "1"`},
|
||||||
|
ifSucess: []string{`get "key \"with\" space"`},
|
||||||
|
results: []string{"SUCCESS", `key "with" space`, "value \x23"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
if err := ctlV3Txn(cx, rqs); err != nil {
|
for _, rq := range rqs {
|
||||||
cx.t.Fatal(err)
|
if err := ctlV3Txn(cx, rq); err != nil {
|
||||||
|
cx.t.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user