]> gitweb.factorcode.org Git - factor.git/blob - extra/calendar/holidays/us/us-tests.factor
calendar.holidays.us: Update nth day of week for base 0.
[factor.git] / extra / calendar / holidays / us / us-tests.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: calendar calendar.holidays calendar.holidays.us kernel
4 sequences tools.test ;
5
6 { 10 } [ 2009 us-federal holidays length ] unit-test
7
8 {
9     {
10         T{ timestamp
11             { year 2020 }
12             { month 1 }
13             { day 1 }
14             { gmt-offset T{ duration { hour -6 } } }
15         }
16         T{ timestamp
17             { year 2020 }
18             { month 1 }
19             { day 20 }
20             { gmt-offset T{ duration { hour -6 } } }
21         }
22         T{ timestamp
23             { year 2020 }
24             { month 2 }
25             { day 17 }
26             { gmt-offset T{ duration { hour -6 } } }
27         }
28         T{ timestamp
29             { year 2020 }
30             { month 5 }
31             { day 25 }
32             { gmt-offset T{ duration { hour -6 } } }
33         }
34         T{ timestamp
35             { year 2020 }
36             { month 7 }
37             { day 3 }
38             { gmt-offset T{ duration { hour -6 } } }
39         }
40         T{ timestamp
41             { year 2020 }
42             { month 9 }
43             { day 7 }
44             { gmt-offset T{ duration { hour -6 } } }
45         }
46         T{ timestamp
47             { year 2020 }
48             { month 10 }
49             { day 12 }
50             { gmt-offset T{ duration { hour -6 } } }
51         }
52         T{ timestamp
53             { year 2020 }
54             { month 11 }
55             { day 11 }
56             { gmt-offset T{ duration { hour -6 } } }
57         }
58         T{ timestamp
59             { year 2020 }
60             { month 11 }
61             { day 26 }
62             { gmt-offset T{ duration { hour -6 } } }
63         }
64         T{ timestamp
65             { year 2020 }
66             { month 12 }
67             { day 25 }
68             { gmt-offset T{ duration { hour -6 } } }
69         }
70     }
71 } [
72     2020 <year> timestamp>year-dates [ us-federal holiday? ] filter
73 ] unit-test