Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Unified Diff: trivial/trivial_test.go

Issue 8322043: state: add environment persistency with UUID (Closed)
Patch Set: state: add environment persistency with UUID Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « state/watcher.go ('k') | trivial/uuid.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trivial/trivial_test.go
=== modified file 'trivial/trivial_test.go'
--- trivial/trivial_test.go 2013-01-21 19:49:21 +0000
+++ trivial/trivial_test.go 2013-04-08 16:19:50 +0000
@@ -107,3 +107,21 @@
c.Assert(err, IsNil)
c.Assert(data1, DeepEquals, data)
}
+
+func (trivialSuite) TestUUID(c *C) {
+ uuid, err := trivial.NewUUID()
+ c.Assert(err, IsNil)
+ uuidCopy := uuid.Copy()
+ uuidRaw := uuid.Raw()
+ uuidStr := uuid.String()
+ c.Assert(uuidRaw, HasLen, 16)
+ c.Assert(uuidStr, Matches, "[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[8,9,a,b][0-9a-f]{3}-[0-9a-f]{12}")
+ uuid[0] = 0x00
+ uuidCopy[0] = 0xFF
+ c.Assert(uuid, Not(DeepEquals), uuidCopy)
+ uuidRaw[0] = 0xFF
+ c.Assert(uuid, Not(DeepEquals), uuidRaw)
+ nextUUID, err := trivial.NewUUID()
+ c.Assert(err, IsNil)
+ c.Assert(uuid, Not(DeepEquals), nextUUID)
+}
« no previous file with comments | « state/watcher.go ('k') | trivial/uuid.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b