CompileArgs

This commit is contained in:
Taylor Gerring
2015-03-26 20:31:00 +01:00
parent ddcc8e1673
commit 81f36df910
2 changed files with 38 additions and 4 deletions

View File

@ -1126,6 +1126,36 @@ func TestCompileArgs(t *testing.T) {
}
}
func TestCompileArgsInvalid(t *testing.T) {
input := `{}`
args := new(CompileArgs)
str := ExpectDecodeParamError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestCompileArgsEmpty(t *testing.T) {
input := `[]`
args := new(CompileArgs)
str := ExpectInsufficientParamsError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestCompileArgsBool(t *testing.T) {
input := `[false]`
args := new(CompileArgs)
str := ExpectInvalidTypeError(json.Unmarshal([]byte(input), args))
if len(str) > 0 {
t.Error(str)
}
}
func TestFilterStringArgs(t *testing.T) {
input := `["pending"]`
expected := new(FilterStringArgs)