-
Notifications
You must be signed in to change notification settings - Fork 22
/
time_test.go
67 lines (61 loc) · 1015 Bytes
/
time_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 xtables
import "testing"
func TestDaytime(t *testing.T) {
dt := &Daytime{
Hour: -1,
Minute: -1,
Second: -1,
}
t.Log(dt.String())
dt = &Daytime{
Hour: 23,
Minute: -1,
Second: -1,
}
t.Log(dt.String())
dt = &Daytime{
Hour: 23,
Minute: 59,
Second: 59}
t.Log(dt.String())
}
func TestYeartime(t *testing.T) {
yt := &Yeartime{
Year: -1,
Month: -1,
Day: -1,
}
t.Log(yt.String())
yt = &Yeartime{
Year: 2022,
Month: -1,
Day: -1,
}
t.Log(yt.String())
yt = &Yeartime{
Year: 2022,
Month: 12,
Day: 31,
}
t.Log(yt.String())
}
func TestDate(t *testing.T) {
date := &Date{}
date.Yeartime = &Yeartime{
Year: 2022,
Month: 12,
Day: 31}
date.Daytime = &Daytime{
Hour: 23,
Minute: 59,
Second: 59}
t.Log(date.String())
}
func TestWeekday(t *testing.T) {
weekday := Weekday(Monday | Tuesday | Wednesday)
t.Log(weekday.String())
}
func TestMonthday(t *testing.T) {
weekday := Monthday(1<<(1-1) | 1<<(31-1))
t.Log(weekday.String())
}