From fc90fa939ef79fdc51b5e47298fb901ff4381c99 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 31 Aug 2016 16:59:26 -0700 Subject: [PATCH] e2e: add quoted key/value to txn test --- e2e/ctl_v3_txn_test.go | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/e2e/ctl_v3_txn_test.go b/e2e/ctl_v3_txn_test.go index 88e545750057..b2276a056b98 100644 --- a/e2e/ctl_v3_txn_test.go +++ b/e2e/ctl_v3_txn_test.go @@ -39,15 +39,23 @@ func txnTestSuccess(cx ctlCtx) { if err := ctlV3Put(cx, "key2", "value2", ""); err != nil { cx.t.Fatalf("txnTestSuccess ctlV3Put error (%v)", err) } - - rqs := txnRequests{ - compare: []string{`version("key1") = "1"`, `version("key2") = "1"`}, - ifSucess: []string{"get key1", "get key2"}, - ifFail: []string{`put key1 "fail"`, `put key2 "fail"`}, - results: []string{"SUCCESS", "key1", "value1", "key2", "value2"}, - } - if err := ctlV3Txn(cx, rqs); err != nil { - cx.t.Fatal(err) + rqs := []txnRequests{ + { + compare: []string{`version("key1") = "1"`, `version("key2") = "1"`}, + ifSucess: []string{"get key1", "get key2", `put "key \"with\" space" "value \x23"`}, + ifFail: []string{`put key1 "fail"`, `put key2 "fail"`}, + 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"}, + }, + } + for _, rq := range rqs { + if err := ctlV3Txn(cx, rq); err != nil { + cx.t.Fatal(err) + } } }