aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/args_test.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-27 03:31:00 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-27 03:31:00 +0800
commit81f36df910533de63dc5ac66f38b5481961cc0c8 (patch)
tree3c6bf52b299ae7dba1b7409632ab500d10a915e7 /rpc/args_test.go
parentddcc8e1673f240556f7a9394d5fbc9ed609a4931 (diff)
downloadgo-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar.gz
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar.bz2
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar.lz
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar.xz
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.tar.zst
go-tangerine-81f36df910533de63dc5ac66f38b5481961cc0c8.zip
CompileArgs
Diffstat (limited to 'rpc/args_test.go')
-rw-r--r--rpc/args_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/rpc/args_test.go b/rpc/args_test.go
index 0b243e760..7cb63b67e 100644
--- a/rpc/args_test.go
+++ b/rpc/args_test.go
@@ -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)