1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-11-24 20:10:06 -05:00

Add test for RandomUID

This commit is contained in:
Aaron Lindsay 2017-04-08 10:55:11 -04:00
parent e1c4fb79bc
commit 749c2e9f3a

View File

@ -363,3 +363,13 @@ func TestUIDRecommendedFormat(t *testing.T) {
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)
}
}