mirror of https://github.com/v2ray/v2ray-core
fix test break
parent
50957b9973
commit
bbdc692a93
|
@ -11,18 +11,18 @@ import (
|
||||||
"github.com/v2ray/v2ray-core/testing/assert"
|
"github.com/v2ray/v2ray-core/testing/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInvalidStringLiteralJson(t *testing.T) {
|
func TestInvalidStringTJson(t *testing.T) {
|
||||||
v2testing.Current(t)
|
v2testing.Current(t)
|
||||||
|
|
||||||
var s StringLiteral
|
var s StringT
|
||||||
err := json.Unmarshal([]byte("1"), &s)
|
err := json.Unmarshal([]byte("1"), &s)
|
||||||
assert.Error(err).IsNotNil()
|
assert.Error(err).IsNotNil()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStringLiteralParsing(t *testing.T) {
|
func TestStringTParsing(t *testing.T) {
|
||||||
v2testing.Current(t)
|
v2testing.Current(t)
|
||||||
|
|
||||||
var s StringLiteral
|
var s StringT
|
||||||
err := json.Unmarshal([]byte("\"1\""), &s)
|
err := json.Unmarshal([]byte("\"1\""), &s)
|
||||||
assert.Error(err).IsNil()
|
assert.Error(err).IsNil()
|
||||||
assert.String(s).Equals("1")
|
assert.String(s).Equals("1")
|
||||||
|
|
|
@ -15,7 +15,7 @@ func TestStringListUnmarshalError(t *testing.T) {
|
||||||
v2testing.Current(t)
|
v2testing.Current(t)
|
||||||
|
|
||||||
rawJson := `1234`
|
rawJson := `1234`
|
||||||
list := new(StringLiteralList)
|
list := new(StringTList)
|
||||||
err := json.Unmarshal([]byte(rawJson), list)
|
err := json.Unmarshal([]byte(rawJson), list)
|
||||||
assert.Error(err).IsNotNil()
|
assert.Error(err).IsNotNil()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue