mirror of
https://github.com/aclindsa/ofxgo.git
synced 2024-11-22 03:30:04 -05:00
Add test for RandomUID
This commit is contained in:
parent
e1c4fb79bc
commit
749c2e9f3a
@ -363,3 +363,13 @@ func TestUIDRecommendedFormat(t *testing.T) {
|
|||||||
t.Fatalf("UID should have failed validation because its hyphens have been replaced\n")
|
t.Fatalf("UID should have failed validation because its hyphens have been replaced\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRandomUID(t *testing.T) {
|
||||||
|
uid, err := ofxgo.RandomUID()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Unexpected error when calling RandomUID: %s\n", err)
|
||||||
|
}
|
||||||
|
if ok, err := uid.RecommendedFormat(); !ok || err != nil {
|
||||||
|
t.Fatalf("UID generated with RandomUID() doesn't match recommended format: %s\n", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user