1
|
|
|
// Note: the month in a Date object is 0-indexed, i.e. new Date(2016, 11, 20) |
2
|
|
|
// is the 20th of December, 2016. Unfortunately, new Date(2016, 12, 20) will |
3
|
|
|
// not produce an error and will happily and *silently* (yes...) give you a |
4
|
|
|
// Date object representing the 20th of *January*, 2016. Nice, right?... :( |
5
|
|
|
|
6
|
|
|
const test_dates = [ |
7
|
|
|
(new Date(2016, 10, 19)), |
8
|
|
|
(new Date(2016, 10, 20)), |
9
|
|
|
(new Date(2016, 10, 21)), |
10
|
|
|
(new Date(2016, 10, 22)), |
11
|
|
|
(new Date(2016, 11, 1)), |
12
|
|
|
(new Date(2016, 11, 2)), |
13
|
|
|
(new Date(2016, 11, 3)) |
14
|
|
|
]; |
15
|
|
|
exports.test_dates = test_dates; |
16
|
|
|
|
17
|
|
|
let potd_using_default_seed = {}; |
18
|
|
|
potd_using_default_seed[test_dates[0].getTime()] = '2BEIRWLZ35'; |
19
|
|
|
potd_using_default_seed[test_dates[1].getTime()] = 'O2A2MLL32D'; |
20
|
|
|
potd_using_default_seed[test_dates[2].getTime()] = 'K716USYKFR'; |
21
|
|
|
potd_using_default_seed[test_dates[3].getTime()] = 'NUD21IN1EV'; |
22
|
|
|
potd_using_default_seed[test_dates[4].getTime()] = '1F3I94R4FO'; |
23
|
|
|
potd_using_default_seed[test_dates[5].getTime()] = '64Y3MJRL0N'; |
24
|
|
|
potd_using_default_seed[test_dates[6].getTime()] = 'DTARW8TPKM'; |
25
|
|
|
exports.potd_using_default_seed = potd_using_default_seed; |
26
|
|
|
|
27
|
|
|
exports.custom_seed = 'ABCDEFGHIJ'; |
28
|
|
|
|
29
|
|
|
let potd_using_custom_seed = {}; |
30
|
|
|
potd_using_custom_seed[test_dates[0].getTime()] = 'KF6WGPG74Q'; |
31
|
|
|
potd_using_custom_seed[test_dates[1].getTime()] = '2DL07E57EK'; |
32
|
|
|
potd_using_custom_seed[test_dates[2].getTime()] = 'E93CGHF957'; |
33
|
|
|
potd_using_custom_seed[test_dates[3].getTime()] = 'EG304636TM'; |
34
|
|
|
potd_using_custom_seed[test_dates[4].getTime()] = '9KEWMOYQ82'; |
35
|
|
|
potd_using_custom_seed[test_dates[5].getTime()] = 'IBV5K74ER9'; |
36
|
|
|
potd_using_custom_seed[test_dates[6].getTime()] = 'ELEXOJ6B2Q'; |
37
|
|
|
exports.potd_using_custom_seed = potd_using_custom_seed; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* list 1 is always the same for both default and custom seeds |
41
|
|
|
* because it only depends on the date. |
42
|
|
|
*/ |
43
|
|
|
exports.test_list1 = { |
44
|
|
|
'1479513600000': [ 34, 27, 16, 23, 30, 19, 8, 3 ], |
45
|
|
|
'1479600000000': [ 14, 22, 24, 17, 13, 20, 7, 9 ], |
46
|
|
|
'1479686400000': [ 15, 15, 24, 20, 24, 21, 6, 15 ], |
47
|
|
|
'1479772800000': [ 13, 14, 27, 32, 10, 22, 5, 21 ], |
48
|
|
|
'1480550400000': [ 23, 32, 24, 29, 29, 1, 27, 7 ], |
49
|
|
|
'1480636800000': [ 14, 29, 10, 21, 29, 2, 26, 14 ], |
50
|
|
|
'1480723200000': [ 34, 27, 16, 23, 30, 3, 25, 21 ] |
51
|
|
|
}; |
52
|
|
|
|
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Data for default seed lists. |
56
|
|
|
*/ |
57
|
|
|
|
58
|
|
|
exports.test_list2_using_default_seed = [ 5, 8, 11, 2, 3, 5, 32, 0 ]; |
59
|
|
|
|
60
|
|
|
exports.test_list3_using_default_seed = { |
61
|
|
|
'1479513600000': [ 3, 35, 27, 25, 33, 24, 4, 3, 10, 16 ], |
62
|
|
|
'1479600000000': [ 19, 30, 35, 19, 16, 25, 3, 9, 12, 0 ], |
63
|
|
|
'1479686400000': [ 20, 23, 35, 22, 27, 26, 2, 15, 26, 4 ], |
64
|
|
|
'1479772800000': [ 18, 22, 2, 34, 13, 27, 1, 21, 30, 0 ], |
65
|
|
|
'1480550400000': [ 28, 4, 35, 31, 32, 6, 23, 7, 22, 16 ], |
66
|
|
|
'1480636800000': [ 19, 1, 21, 23, 32, 7, 22, 14, 31, 1 ], |
67
|
|
|
'1480723200000': [ 3, 35, 27, 25, 33, 8, 21, 21, 29, 25 ] |
68
|
|
|
}; |
69
|
|
|
|
70
|
|
|
exports.test_list4_using_default_seed = { |
71
|
|
|
'1479513600000': [ 33, 3, 3, 16, 24, 27, 25, 35, 10, 4 ], |
72
|
|
|
'1479600000000': [ 19, 30, 35, 0, 19, 16, 25, 3, 9, 12 ], |
73
|
|
|
'1479686400000': [ 15, 35, 26, 4, 27, 23, 2, 20, 22, 26 ], |
74
|
|
|
'1479772800000': [ 18, 22, 2, 0, 34, 13, 27, 1, 21, 30 ], |
75
|
|
|
'1480550400000': [ 32, 7, 28, 16, 6, 35, 31, 4, 22, 23 ], |
76
|
|
|
'1480636800000': [ 1, 32, 23, 1, 19, 14, 31, 21, 7, 22 ], |
77
|
|
|
'1480723200000': [ 8, 21, 35, 25, 29, 3, 33, 25, 27, 21 ] |
78
|
|
|
}; |
79
|
|
|
|
80
|
|
|
exports.test_list5_using_default_seed = { |
81
|
|
|
'1479513600000': [ 2, 11, 14, 18, 27, 32, 21, 35, 3, 5 ], |
82
|
|
|
'1479600000000': [ 24, 2, 10, 2, 22, 21, 21, 3, 2, 13 ], |
83
|
|
|
'1479686400000': [ 20, 7, 1, 6, 30, 28, 34, 20, 15, 27 ], |
84
|
|
|
'1479772800000': [ 23, 30, 13, 2, 1, 18, 23, 1, 14, 31 ], |
85
|
|
|
'1480550400000': [ 1, 15, 3, 18, 9, 4, 27, 4, 15, 24 ], |
86
|
|
|
'1480636800000': [ 6, 4, 34, 3, 22, 19, 27, 21, 0, 23 ], |
87
|
|
|
'1480723200000': [ 13, 29, 10, 27, 32, 8, 29, 25, 20, 22 ] |
88
|
|
|
}; |
89
|
|
|
|
90
|
|
|
exports.test_num8_using_default_seed = { |
91
|
|
|
'1479513600000': 4, |
92
|
|
|
'1479600000000': 0, |
93
|
|
|
'1479686400000': 2, |
94
|
|
|
'1479772800000': 0, |
95
|
|
|
'1480550400000': 4, |
96
|
|
|
'1480636800000': 1, |
97
|
|
|
'1480723200000': 5 |
98
|
|
|
}; |
99
|
|
|
|
100
|
|
|
exports.test_indexers_using_default_seed = { |
101
|
|
|
'1479513600000': [ 2, 11, 14, 18, 27, 32, 21, 35, 3, 5 ], |
102
|
|
|
'1479600000000': [ 24, 2, 10, 2, 22, 21, 21, 3, 2, 13 ], |
103
|
|
|
'1479686400000': [ 20, 7, 1, 6, 30, 28, 34, 20, 15, 27 ], |
104
|
|
|
'1479772800000': [ 23, 30, 13, 2, 1, 18, 23, 1, 14, 31 ], |
105
|
|
|
'1480550400000': [ 1, 15, 3, 18, 9, 4, 27, 4, 15, 24 ], |
106
|
|
|
'1480636800000': [ 6, 4, 34, 3, 22, 19, 27, 21, 0, 23 ], |
107
|
|
|
'1480723200000': [ 13, 29, 10, 27, 32, 8, 29, 25, 20, 22 ] |
108
|
|
|
}; |
109
|
|
|
|
110
|
|
|
|
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* Data for custom seed lists. |
114
|
|
|
*/ |
115
|
|
|
|
116
|
|
|
exports.test_list2_using_custom_seed = [ 29, 30, 31, 32, 33, 34, 35, 0 ]; |
117
|
|
|
|
118
|
|
|
exports.test_list3_using_custom_seed = { |
119
|
|
|
'1479513600000': [ 27, 21, 11, 19, 27, 17, 7, 3, 24, 0 ], |
120
|
|
|
'1479600000000': [ 7, 16, 19, 13, 10, 18, 6, 9, 26, 4 ], |
121
|
|
|
'1479686400000': [ 8, 9, 19, 16, 21, 19, 5, 15, 4, 16 ], |
122
|
|
|
'1479772800000': [ 6, 8, 22, 28, 7, 20, 4, 21, 8, 4 ], |
123
|
|
|
'1480550400000': [ 16, 26, 19, 25, 26, 35, 26, 7, 0, 0 ], |
124
|
|
|
'1480636800000': [ 7, 23, 5, 17, 26, 0, 25, 14, 9, 9 ], |
125
|
|
|
'1480723200000': [ 27, 21, 11, 19, 27, 1, 24, 21, 7, 1 ] |
126
|
|
|
}; |
127
|
|
|
|
128
|
|
|
exports.test_list4_using_custom_seed = { |
129
|
|
|
'1479513600000': [ 27, 21, 11, 0, 19, 27, 17, 7, 3, 24 ], |
130
|
|
|
'1479600000000': [ 9, 19, 26, 4, 10, 16, 6, 7, 13, 18 ], |
131
|
|
|
'1479686400000': [ 21, 15, 8, 16, 19, 19, 16, 9, 4, 5 ], |
132
|
|
|
'1479772800000': [ 21, 22, 8, 4, 7, 8, 4, 6, 28, 20 ], |
133
|
|
|
'1480550400000': [ 16, 26, 19, 0, 25, 26, 35, 26, 7, 0 ], |
134
|
|
|
'1480636800000': [ 25, 17, 0, 9, 23, 9, 5, 14, 26, 7 ], |
135
|
|
|
'1480723200000': [ 21, 27, 19, 1, 27, 21, 7, 11, 1, 24 ] |
136
|
|
|
}; |
137
|
|
|
|
138
|
|
|
exports.test_list5_using_custom_seed = { |
139
|
|
|
'1479513600000': [ 20, 15, 6, 32, 16, 25, 16, 7, 4, 26 ], |
140
|
|
|
'1479600000000': [ 2, 13, 21, 0, 7, 14, 5, 7, 14, 20 ], |
141
|
|
|
'1479686400000': [ 14, 9, 3, 12, 16, 17, 15, 9, 5, 7 ], |
142
|
|
|
'1479772800000': [ 14, 16, 3, 0, 4, 6, 3, 6, 29, 22 ], |
143
|
|
|
'1480550400000': [ 9, 20, 14, 32, 22, 24, 34, 26, 8, 2 ], |
144
|
|
|
'1480636800000': [ 18, 11, 31, 5, 20, 7, 4, 14, 27, 9 ], |
145
|
|
|
'1480723200000': [ 14, 21, 14, 33, 24, 19, 6, 11, 2, 26 ] |
146
|
|
|
}; |
147
|
|
|
|
148
|
|
|
exports.test_num8_using_custom_seed ={ |
149
|
|
|
'1479513600000': 0, |
150
|
|
|
'1479600000000': 2, |
151
|
|
|
'1479686400000': 4, |
152
|
|
|
'1479772800000': 2, |
153
|
|
|
'1480550400000': 0, |
154
|
|
|
'1480636800000': 3, |
155
|
|
|
'1480723200000': 1 |
156
|
|
|
}; |
157
|
|
|
|
158
|
|
|
exports.test_indexers_using_custom_seed = { |
159
|
|
|
'1479513600000': [ 20, 15, 6, 32, 16, 25, 16, 7, 4, 26 ], |
160
|
|
|
'1479600000000': [ 2, 13, 21, 0, 7, 14, 5, 7, 14, 20 ], |
161
|
|
|
'1479686400000': [ 14, 9, 3, 12, 16, 17, 15, 9, 5, 7 ], |
162
|
|
|
'1479772800000': [ 14, 16, 3, 0, 4, 6, 3, 6, 29, 22 ], |
163
|
|
|
'1480550400000': [ 9, 20, 14, 32, 22, 24, 34, 26, 8, 2 ], |
164
|
|
|
'1480636800000': [ 18, 11, 31, 5, 20, 7, 4, 14, 27, 9 ], |
165
|
|
|
'1480723200000': [ 14, 21, 14, 33, 24, 19, 6, 11, 2, 26 ] |
166
|
|
|
}; |
167
|
|
|
|