1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-03 04:25:23 +00:00
v2fly/common/serial/typed_message_test.go

25 lines
429 B
Go
Raw Normal View History

2017-04-28 18:37:49 +00:00
package serial_test
import (
"testing"
2021-02-16 20:31:50 +00:00
. "github.com/v2fly/v2ray-core/v4/common/serial"
2017-04-28 18:37:49 +00:00
)
func TestGetInstance(t *testing.T) {
p, err := GetInstance("")
2019-01-31 19:57:01 +00:00
if p != nil {
t.Error("expected nil instance, but got ", p)
}
if err == nil {
t.Error("expect non-nil error, but got nil")
}
2017-04-28 18:37:49 +00:00
}
2018-11-13 21:46:01 +00:00
func TestConvertingNilMessage(t *testing.T) {
x := ToTypedMessage(nil)
if x != nil {
t.Error("expect nil, but actually not")
}
}