提交 47eea7fd 作者: Matt Bell 提交者: Juan Batiz-Benet

commands: Added a option validation test for convertible string values

上级 1e8719e7
......@@ -62,6 +62,20 @@ func TestOptionValidation(t *testing.T) {
if res.Error != nil {
t.Error("Should have passed")
}
req = NewRequest()
req.options["b"] = "100"
res = cmd.Call(req)
if res.Error != nil {
t.Error("Should have passed")
}
req = NewRequest()
req.options["b"] = ":)"
res = cmd.Call(req)
if res.Error == nil {
t.Error(res.Error, "Should have failed (string value not convertible to int)")
}
}
func TestRegistration(t *testing.T) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论