-
Notifications
You must be signed in to change notification settings - Fork 0
/
national_holiday_test.go
55 lines (51 loc) · 1.97 KB
/
national_holiday_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
package flagday_test
import (
"testing"
"github.com/pinzolo/flagday"
)
func TestNationalHoliday(t *testing.T) {
testdata := []expected{
{1, 1, "元日", flagday.PublicHoliday},
{1, 12, "成人の日", flagday.PublicHoliday},
{2, 11, "建国記念の日", flagday.PublicHoliday},
{3, 21, "春分の日", flagday.PublicHoliday},
{4, 29, "昭和の日", flagday.PublicHoliday},
{5, 3, "憲法記念日", flagday.PublicHoliday},
{5, 4, "みどりの日", flagday.PublicHoliday},
{5, 5, "こどもの日", flagday.PublicHoliday},
{5, 6, "振替休日", flagday.SubstituteHoliday},
{7, 20, "海の日", flagday.PublicHoliday},
{9, 21, "敬老の日", flagday.PublicHoliday},
{9, 22, "国民の休日", flagday.NationalHoliday},
{9, 23, "秋分の日", flagday.PublicHoliday},
{10, 12, "体育の日", flagday.PublicHoliday},
{11, 3, "文化の日", flagday.PublicHoliday},
{11, 23, "勤労感謝の日", flagday.PublicHoliday},
{12, 23, "天皇誕生日", flagday.PublicHoliday},
}
year := 2015
dates := flagday.InYear(year)
testHolidays(t, year, dates, testdata)
}
func TestNationalHolidayBefore(t *testing.T) {
testdata := []expected{
{1, 1, "元日", flagday.PublicHoliday},
{1, 15, "成人の日", flagday.PublicHoliday},
{2, 11, "建国記念の日", flagday.PublicHoliday},
{3, 21, "春分の日", flagday.PublicHoliday},
{3, 22, "振替休日", flagday.SubstituteHoliday},
{4, 29, "天皇誕生日", flagday.PublicHoliday},
{5, 3, "憲法記念日", flagday.PublicHoliday},
// 5/4 is not holiday
{5, 5, "こどもの日", flagday.PublicHoliday},
{9, 15, "敬老の日", flagday.PublicHoliday},
{9, 23, "秋分の日", flagday.PublicHoliday},
{10, 10, "体育の日", flagday.PublicHoliday},
{10, 11, "振替休日", flagday.SubstituteHoliday},
{11, 03, "文化の日", flagday.PublicHoliday},
{11, 23, "勤労感謝の日", flagday.PublicHoliday},
}
year := 1982
dates := flagday.InYear(year)
testHolidays(t, year, dates, testdata)
}