Skip to content

Commit

Permalink
e2e: test 'print-value-only' flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho committed Aug 26, 2016
1 parent f042774 commit 073049f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions e2e/ctl_v3_kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,23 @@ func getFormatTest(cx ctlCtx) {
}

tests := []struct {
format string
format string
valueOnly bool

wstr string
}{
{"simple", "abc"},
{"json", `"kvs":[{"key":"YWJj"`},
{"protobuf", "\x17\b\x93\xe7\xf6\x93\xd4ņ\xe14\x10\xed"},
{"simple", false, "abc"},
{"simple", true, "123"},
{"json", false, `"kvs":[{"key":"YWJj"`},
{"protobuf", false, "\x17\b\x93\xe7\xf6\x93\xd4ņ\xe14\x10\xed"},
}

for i, tt := range tests {
cmdArgs := append(cx.PrefixArgs(), "get")
cmdArgs = append(cmdArgs, "--write-out="+tt.format)
if tt.valueOnly {
cmdArgs = append(cmdArgs, "--print-value-only")
}
cmdArgs = append(cmdArgs, "abc")
if err := spawnWithExpect(cmdArgs, tt.wstr); err != nil {
cx.t.Errorf("#%d: error (%v), wanted %v", i, err, tt.wstr)
Expand Down

0 comments on commit 073049f

Please sign in to comment.