diff --git a/common/uuid/uuid_test.go b/common/uuid/uuid_test.go index e5d7d9b8..a2a92c0e 100644 --- a/common/uuid/uuid_test.go +++ b/common/uuid/uuid_test.go @@ -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) {