github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/common/protocol/id_test.go (about) 1 package protocol_test 2 3 import ( 4 "testing" 5 6 . "v2ray.com/core/common/protocol" 7 "v2ray.com/core/common/uuid" 8 ) 9 10 func TestIdEquals(t *testing.T) { 11 id1 := NewID(uuid.New()) 12 id2 := NewID(id1.UUID()) 13 14 if !id1.Equals(id2) { 15 t.Error("expected id1 to equal id2, but actually not") 16 } 17 18 if id1.String() != id2.String() { 19 t.Error(id1.String(), " != ", id2.String()) 20 } 21 }