mirror of https://github.com/v2ray/v2ray-core
more test cases for uuid
parent
7f4ff04483
commit
8180145413
|
@ -17,6 +17,9 @@ func TestParseBytes(t *testing.T) {
|
|||
uuid, err := ParseBytes(bytes)
|
||||
assert.Error(err).IsNil()
|
||||
assert.String(uuid).Equals(str)
|
||||
|
||||
uuid, err = ParseBytes([]byte{1, 3, 2, 4})
|
||||
assert.Error(err).Equals(InvalidID)
|
||||
}
|
||||
|
||||
func TestParseString(t *testing.T) {
|
||||
|
@ -28,6 +31,12 @@ func TestParseString(t *testing.T) {
|
|||
uuid, err := ParseString(str)
|
||||
assert.Error(err).IsNil()
|
||||
assert.Bytes(uuid.Bytes()).Equals(expectedBytes)
|
||||
|
||||
uuid, err = ParseString("2418d087")
|
||||
assert.Error(err).Equals(InvalidID)
|
||||
|
||||
uuid, err = ParseString("2418d087-648k-4990-86e8-19dca1d006d3")
|
||||
assert.Error(err).IsNotNil()
|
||||
}
|
||||
|
||||
func TestNewUUID(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue