|
|
|
|
@ -35,34 +35,89 @@ test.each([ |
|
|
|
|
|
|
|
|
|
test.each([ |
|
|
|
|
[ |
|
|
|
|
'<t:2025-07-22T10:00:00.000Z:R>', |
|
|
|
|
[paragraph([timestamp('1753178400000', 'R')])], |
|
|
|
|
'<t:2025-07-22T10:00:00.000+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp( |
|
|
|
|
(Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), |
|
|
|
|
'R', |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:2025-07-22T10:00:00.000Z:R>', |
|
|
|
|
[paragraph([timestamp('1753178400000', 'R')])], |
|
|
|
|
'<t:2025-07-22T10:00:00.000+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp( |
|
|
|
|
(Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), |
|
|
|
|
'R', |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:2025-07-22T10:00:00.000:R>', |
|
|
|
|
[paragraph([timestamp('1753178400000', 'R')])], |
|
|
|
|
'<t:2025-07-22T10:00:00.000+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp( |
|
|
|
|
(Date.parse('2025-07-22T10:00:00.000+00:00') / 1000).toString(), |
|
|
|
|
'R', |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
['<t:2025-07-22T10:00:00:R>', [paragraph([timestamp('1753178400000', 'R')])]], |
|
|
|
|
[ |
|
|
|
|
'<t:10:00:00:R>', |
|
|
|
|
[paragraph([timestamp(timestampFromHours('10', '00', '00'), 'R')])], |
|
|
|
|
'<t:2025-07-22T10:00:00+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp( |
|
|
|
|
(Date.parse('2025-07-22T10:00:00+00:00') / 1000).toString(), |
|
|
|
|
'R', |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:10:00:R>', |
|
|
|
|
[paragraph([timestamp(timestampFromHours('10', '00', '00'), 'R')])], |
|
|
|
|
'<t:10:00:00+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp(timestampFromHours('10', '00', '00', '+00:00'), 'R'), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:10:00:00>', |
|
|
|
|
[paragraph([timestamp(timestampFromHours('10', '00', '00'), 't')])], |
|
|
|
|
'<t:10:00+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp(timestampFromHours('10', '00', '00', '+00:00'), 'R'), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:10:00:05+00:00>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp(timestampFromHours('10', '00', '05', '+00:00'), 't'), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
[ |
|
|
|
|
'<t:10:00>', |
|
|
|
|
'<t:10:00+00:00>', |
|
|
|
|
[paragraph([timestamp(timestampFromHours('10', '00', '00'), 't')])], |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
[ |
|
|
|
|
'<t:2025-07-24T20:19:58.154+00:00:R>', |
|
|
|
|
[ |
|
|
|
|
paragraph([ |
|
|
|
|
timestamp( |
|
|
|
|
((Date.parse('2025-07-24T20:19:58.154+00:00') / 1000) | 0).toString(), |
|
|
|
|
'R', |
|
|
|
|
), |
|
|
|
|
]), |
|
|
|
|
], |
|
|
|
|
], |
|
|
|
|
])('parses %p', (input, output) => { |
|
|
|
|
expect(parse(input)).toMatchObject(output); |
|
|
|
|
}); |
|
|
|
|
|