Commit 47eea7fd authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Added a option validation test for convertible string values

parent 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 is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment