-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat_test.go
More file actions
72 lines (70 loc) · 1.36 KB
/
format_test.go
File metadata and controls
72 lines (70 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package internationalcolortime
import "testing"
func TestInternationalColorTime_Format(t *testing.T) {
type args struct {
layout string
}
tests := []struct {
name string
field InternationalColorTime
args args
want string
}{
{
name: "Long Name",
field: ColorTime(Blue, 15, 0, 0),
args: args{
layout: ICTStandardLongName,
},
want: "Blue:15:00",
},
{
name: "Long Name 2",
field: ColorTime(Pink, 59, 33, 0),
args: args{
layout: ICTStandardLongName,
},
want: "Pink:59:33",
},
{
name: "Long Name 3 w/ nanos",
field: ColorTime(Denim, 22, 17, 999000000),
args: args{
layout: ICTStandardLongName,
},
want: "Denim:22:17.999",
},
{
name: "Short Name",
field: ColorTime(Blue, 15, 0, 0),
args: args{
layout: ICTStandardShortName,
},
want: "BLU:15:00",
},
{
name: "Short Name 2",
field: ColorTime(Green, 45, 22, 0),
args: args{
layout: ICTStandardShortName,
},
want: "GRN:45:22",
},
{
name: "Short Name 3 w/ nanos",
field: ColorTime(Yellow, 5, 2, 987623443),
args: args{
layout: ICTStandardShortName,
},
want: "YLW:05:02.987623443",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
i := tt.field
if got := i.Format(tt.args.layout); got != tt.want {
t.Errorf("Format() = %v, want %v", got, tt.want)
}
})
}
}