mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Extend a calendar test.
tests/hard_coded/calendar_test.{m,exp}:
Add further tests of end of month day clamping.
tests/hard_coded/calendar_init_data.m:
Fix typo.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
%---------------------------------------------------------------------------%
|
||||
% vim: ft=mercury ts=4 sw=4 et
|
||||
%---------------------------------------------------------------------------%
|
||||
% Test calendar.init_data/8 and calendar.det_init_date/7.
|
||||
% Test calendar.init_date/8 and calendar.det_init_date/7.
|
||||
%---------------------------------------------------------------------------%
|
||||
|
||||
:- module calendar_init_date.
|
||||
|
||||
@@ -14,6 +14,8 @@ Adding durations to date-times:
|
||||
1901-12-31 00:00:00 + P1D = 1902-01-01 00:00:00
|
||||
1901-12-31 00:00:00 + P1M = 1902-01-31 00:00:00
|
||||
1901-12-31 00:00:00 + P1Y = 1902-12-31 00:00:00
|
||||
2020-02-29 00:00:00 + P1Y = 2021-02-28 00:00:00
|
||||
2020-02-29 00:00:00 + -P1Y = 2019-02-28 00:00:00
|
||||
1901-12-31 00:00:00 + PT1H = 1901-12-31 01:00:00
|
||||
1901-12-31 00:00:00 + PT1M = 1901-12-31 00:01:00
|
||||
1901-12-31 00:00:00 + PT1S = 1901-12-31 00:00:01
|
||||
|
||||
@@ -32,6 +32,8 @@ main(!IO) :-
|
||||
test_add_dur("1901-12-31 00:00:00", "P1D", !IO),
|
||||
test_add_dur("1901-12-31 00:00:00", "P1M", !IO),
|
||||
test_add_dur("1901-12-31 00:00:00", "P1Y", !IO),
|
||||
test_add_dur("2020-02-29 00:00:00", "P1Y", !IO),
|
||||
test_add_dur("2020-02-29 00:00:00", "-P1Y", !IO),
|
||||
test_add_dur("1901-12-31 00:00:00", "PT1H", !IO),
|
||||
test_add_dur("1901-12-31 00:00:00", "PT1M", !IO),
|
||||
test_add_dur("1901-12-31 00:00:00", "PT1S", !IO),
|
||||
|
||||
Reference in New Issue
Block a user