1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-03 06:30:42 +00:00
v2fly/common/serial/typed_message_test.go
2021-02-17 04:31:50 +08:00

25 lines
429 B
Go

package serial_test
import (
"testing"
. "github.com/v2fly/v2ray-core/v4/common/serial"
)
func TestGetInstance(t *testing.T) {
p, err := GetInstance("")
if p != nil {
t.Error("expected nil instance, but got ", p)
}
if err == nil {
t.Error("expect non-nil error, but got nil")
}
}
func TestConvertingNilMessage(t *testing.T) {
x := ToTypedMessage(nil)
if x != nil {
t.Error("expect nil, but actually not")
}
}