-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsts_test.go
67 lines (63 loc) · 1.17 KB
/
consts_test.go
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
package chrono_test
import (
"testing"
"github.com/go-chrono/chrono"
)
func TestWeekday_String(t *testing.T) {
for _, tt := range []struct {
day chrono.Weekday
expected string
}{
{
day: chrono.Weekday(1),
expected: "Monday",
},
{
day: chrono.Weekday(7),
expected: "Sunday",
},
{
day: chrono.Weekday(0),
expected: "%!Weekday(0)",
},
{
day: chrono.Weekday(8),
expected: "%!Weekday(8)",
},
} {
t.Run(tt.expected, func(t *testing.T) {
if out := tt.day.String(); out != tt.expected {
t.Errorf("stringified day = %s, want %s", out, tt.expected)
}
})
}
}
func TestMonth_String(t *testing.T) {
for _, tt := range []struct {
month chrono.Month
expected string
}{
{
month: chrono.Month(0),
expected: "%!Month(0)",
},
{
month: chrono.Month(1),
expected: "January",
},
{
month: chrono.Month(12),
expected: "December",
},
{
month: chrono.Month(13),
expected: "%!Month(13)",
},
} {
t.Run(tt.expected, func(t *testing.T) {
if out := tt.month.String(); out != tt.expected {
t.Errorf("stringified month = %s, want %s", out, tt.expected)
}
})
}
}