Xray-core/common/serial/typed_message_test.go

25 lines
424 B
Go
Raw Normal View History

2020-11-25 11:01:53 +00:00
package serial_test
import (
"testing"
2020-12-04 01:36:16 +00:00
. "github.com/xtls/xray-core/common/serial"
2020-11-25 11:01:53 +00:00
)
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")
}
}