File tree Expand file tree Collapse file tree 1 file changed +39
-39
lines changed
Expand file tree Collapse file tree 1 file changed +39
-39
lines changed Original file line number Diff line number Diff line change 1- package providerid
2-
3- import (
4- "testing"
5- )
6-
7- func TestNew (t * testing.T ) {
8- uuid := ""
9- providerID , err := New (uuid )
10- if err == nil {
11- t .Errorf ("err should not be nil. providerID=%s" , providerID )
12- }
13-
14- uuid = "asdf"
15- providerID , err = New (uuid )
16- if err != nil {
17- t .Errorf ("failed to create providerID: %v" , err )
18- }
19- }
20-
21- func TestUUID (t * testing.T ) {
22- pid := providerID {
23- uuid : "asdf" ,
24- }
25- uuid := pid .UUID ()
26- if uuid != "asdf" {
27- t .Errorf ("should be asdf" )
28- }
29- }
30-
31- func TestString (t * testing.T ) {
32- pid := providerID {
33- uuid : "asdf" ,
34- }
35- uuid := pid .String ()
36- if uuid != Prefix + "asdf" {
37- t .Errorf ("should be %sasdf" , Prefix )
38- }
39- }
1+ package providerid
2+
3+ import (
4+ "testing"
5+ )
6+
7+ func TestNew (t * testing.T ) {
8+ uuid := ""
9+ providerID , err := New (uuid )
10+ if err == nil {
11+ t .Errorf ("err should not be nil. providerID=%s" , providerID )
12+ }
13+
14+ uuid = "asdf"
15+ providerID , err = New (uuid )
16+ if err != nil {
17+ t .Errorf ("failed to create providerID: %v" , err )
18+ }
19+ }
20+
21+ func TestUUID (t * testing.T ) {
22+ pid := providerID {
23+ uuid : "asdf" ,
24+ }
25+ uuid := pid .UUID ()
26+ if uuid != "asdf" {
27+ t .Errorf ("should be asdf" )
28+ }
29+ }
30+
31+ func TestString (t * testing.T ) {
32+ pid := providerID {
33+ uuid : "asdf" ,
34+ }
35+ uuid := pid .String ()
36+ if uuid != Prefix + "asdf" {
37+ t .Errorf ("should be %sasdf" , Prefix )
38+ }
39+ }
You can’t perform that action at this time.
0 commit comments