Skip to content

Commit 01263fa

Browse files
committed
providerid_test.go
1 parent 5d306d3 commit 01263fa

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,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-
}
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+
}

0 commit comments

Comments
 (0)