From 216faf587c3075c8fdaaab24c6ea64642e2c9c5d Mon Sep 17 00:00:00 2001 From: v2ray Date: Fri, 22 Jan 2016 00:53:51 +0100 Subject: [PATCH] string list test --- common/serial/string_list_json_test.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 common/serial/string_list_json_test.go diff --git a/common/serial/string_list_json_test.go b/common/serial/string_list_json_test.go new file mode 100644 index 00000000..6f361e72 --- /dev/null +++ b/common/serial/string_list_json_test.go @@ -0,0 +1,21 @@ +// +build json + +package serial_test + +import ( + "encoding/json" + "testing" + + . "github.com/v2ray/v2ray-core/common/serial" + v2testing "github.com/v2ray/v2ray-core/testing" + "github.com/v2ray/v2ray-core/testing/assert" +) + +func TestStringListUnmarshalError(t *testing.T) { + v2testing.Current(t) + + rawJson := `1234` + list := new(StringLiteralList) + err := json.Unmarshal([]byte(rawJson), list) + assert.Error(err).IsNotNil() +}