mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-09-06 00:09:20 +03:00
25 lines
427 B
Go
25 lines
427 B
Go
|
package serial_test
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
. "github.com/xtls/xray-core/v1/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")
|
||
|
}
|
||
|
}
|