1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-21 20:54:18 -04:00
v2fly/common/collect/string_list_json_test.go

21 lines
370 B
Go
Raw Normal View History

2016-01-21 18:53:51 -05:00
// +build json
2016-05-24 16:41:51 -04:00
package collect_test
2016-01-21 18:53:51 -05:00
import (
"encoding/json"
"testing"
2016-05-24 16:41:51 -04:00
. "github.com/v2ray/v2ray-core/common/collect"
2016-01-21 18:53:51 -05:00
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestStringListUnmarshalError(t *testing.T) {
2016-05-24 15:55:46 -04:00
assert := assert.On(t)
2016-01-21 18:53:51 -05:00
rawJson := `1234`
2016-05-24 16:41:51 -04:00
list := new(StringList)
2016-01-21 18:53:51 -05:00
err := json.Unmarshal([]byte(rawJson), list)
assert.Error(err).IsNotNil()
}