mirror of
https://github.com/google/uuid.git
synced 2024-11-21 17:16:42 +02:00
fix some typos
This commit is contained in:
parent
bb91e0b0e2
commit
9c6b41367e
2
hash.go
2
hash.go
@ -27,7 +27,7 @@ var (
|
||||
func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID {
|
||||
h.Reset()
|
||||
h.Write(space[:])
|
||||
h.Write([]byte(data))
|
||||
h.Write(data)
|
||||
s := h.Sum(nil)
|
||||
var uuid UUID
|
||||
copy(uuid[:], s)
|
||||
|
@ -16,7 +16,7 @@ var regressions = flag.Bool("regressions", false, "run uuid regression tests")
|
||||
|
||||
// TestClockSeqRace tests for a particular race condition of returning two
|
||||
// identical Version1 UUIDs. The duration of 1 minute was chosen as the race
|
||||
// condition, before being fixed, nearly always occured in under 30 seconds.
|
||||
// condition, before being fixed, nearly always occurred in under 30 seconds.
|
||||
func TestClockSeqRace(t *testing.T) {
|
||||
if !*regressions {
|
||||
t.Skip("skipping regression tests")
|
||||
|
10
uuid_test.go
10
uuid_test.go
@ -305,7 +305,7 @@ func TestVersion1(t *testing.T) {
|
||||
case t1 > t2 && q1 == q2:
|
||||
t.Error("time reversed")
|
||||
case t1 < t2 && q1 != q2:
|
||||
t.Error("clock sequence chaned unexpectedly")
|
||||
t.Error("clock sequence changed unexpectedly")
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ func TestNode(t *testing.T) {
|
||||
}
|
||||
|
||||
if ni := NodeInterface(); ni != "user" {
|
||||
t.Errorf("got inteface %q, want %q", ni, "user")
|
||||
t.Errorf("got interface %q, want %q", ni, "user")
|
||||
}
|
||||
}
|
||||
|
||||
@ -392,7 +392,7 @@ func TestNodeID(t *testing.T) {
|
||||
SetNodeInterface("")
|
||||
s := NodeInterface()
|
||||
if s == "" || s == "user" {
|
||||
t.Errorf("NodeInterface %q after SetInteface", s)
|
||||
t.Errorf("NodeInterface %q after SetInterface", s)
|
||||
}
|
||||
node1 := NodeID()
|
||||
if node1 == nil {
|
||||
@ -454,13 +454,13 @@ func TestBadRand(t *testing.T) {
|
||||
uuid1 := New()
|
||||
uuid2 := New()
|
||||
if uuid1 != uuid2 {
|
||||
t.Errorf("execpted duplicates, got %q and %q", uuid1, uuid2)
|
||||
t.Errorf("expected duplicates, got %q and %q", uuid1, uuid2)
|
||||
}
|
||||
SetRand(nil)
|
||||
uuid1 = New()
|
||||
uuid2 = New()
|
||||
if uuid1 == uuid2 {
|
||||
t.Errorf("unexecpted duplicates, got %q", uuid1)
|
||||
t.Errorf("unexpected duplicates, got %q", uuid1)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user