1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 00:45:24 +00:00

more test cases for uuid

This commit is contained in:
Darien Raymond 2016-01-21 12:11:23 +00:00
parent 7f4ff04483
commit 8180145413

View File

@ -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) {