提交 b033e332 作者: Matt Bell 提交者: Juan Batiz-Benet

commands: Fixed test

上级 53e13598
...@@ -12,16 +12,9 @@ func TestOptionValidation(t *testing.T) { ...@@ -12,16 +12,9 @@ func TestOptionValidation(t *testing.T) {
} }
req := NewEmptyRequest() req := NewEmptyRequest()
req.SetOption("foo", 5)
res := cmd.Call(req)
if res.Error() == nil {
t.Error("Should have failed (unrecognized option)")
}
req = NewEmptyRequest()
req.SetOption("beep", 5) req.SetOption("beep", 5)
req.SetOption("b", 10) req.SetOption("b", 10)
res = cmd.Call(req) res := cmd.Call(req)
if res.Error() == nil { if res.Error() == nil {
t.Error("Should have failed (duplicate options)") t.Error("Should have failed (duplicate options)")
} }
...@@ -57,6 +50,13 @@ func TestOptionValidation(t *testing.T) { ...@@ -57,6 +50,13 @@ func TestOptionValidation(t *testing.T) {
} }
req = NewEmptyRequest() req = NewEmptyRequest()
req.SetOption("foo", 5)
res = cmd.Call(req)
if res.Error() != nil {
t.Error("Should have passed")
}
req = NewEmptyRequest()
req.SetOption(EncShort, "json") req.SetOption(EncShort, "json")
res = cmd.Call(req) res = cmd.Call(req)
if res.Error() != nil { if res.Error() != nil {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论