1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-13 00:34:24 -04:00
v2fly/common/serial/typed_message_test.go

24 lines
367 B
Go
Raw Normal View History

2017-04-28 14:37:49 -04:00
package serial_test
import (
"testing"
. "v2ray.com/core/common/serial"
2017-10-24 10:15:35 -04:00
. "v2ray.com/ext/assert"
2017-04-28 14:37:49 -04:00
)
func TestGetInstance(t *testing.T) {
2017-10-24 10:15:35 -04:00
assert := With(t)
2017-04-28 14:37:49 -04:00
p, err := GetInstance("")
2017-10-24 10:15:35 -04:00
assert(p, IsNil)
assert(err, IsNotNil)
2017-04-28 14:37:49 -04:00
}
2018-11-13 16:46:01 -05:00
func TestConvertingNilMessage(t *testing.T) {
x := ToTypedMessage(nil)
if x != nil {
t.Error("expect nil, but actually not")
}
}