Skip to content

Add some tests for iso8601 parsing #3819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cts/cli/regression.dates.exp
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ Duration: 3 months
Duration ends at: 2009-04-30 00:00:00Z
=#=#=#= End test: 2009-01-31 + 3 Months - OK (0) =#=#=#=
* Passed: iso8601 - 2009-01-31 + 3 Months
=#=#=#= Begin test: Test correct immediate plus-sign at timezone parsing =#=#=#=
Date: 1556246574
=#=#=#= End test: Test correct immediate plus-sign at timezone parsing - OK (0) =#=#=#=
* Passed: iso8601 - Test correct immediate plus-sign at timezone parsing
=#=#=#= Begin test: Like the previous, with exotic timezone to avoid false negative =#=#=#=
Date: 1556246574
=#=#=#= End test: Like the previous, with exotic timezone to avoid false negative - OK (0) =#=#=#=
* Passed: iso8601 - Like the previous, with exotic timezone to avoid false negative
=#=#=#= Begin test: 2009-03-31 - 1 Month =#=#=#=
Date: 2009-03-31 00:00:00Z
Duration: -1 months
Expand Down
4 changes: 4 additions & 0 deletions cts/cts-cli.in
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@ class DatesRegressionTest(RegressionTest):
"iso8601 -d '2009-01-31 00:00:00Z' -D P2M -E '2009-03-31 00:00:00Z'"),
Test("2009-01-31 + 3 Months",
"iso8601 -d '2009-01-31 00:00:00Z' -D P3M -E '2009-04-30 00:00:00Z'"),
Test("Test correct immediate plus-sign at timezone parsing",
"iso8601 -d '2019-04-25T21:42:54+0200' -S"),
Test("Like the previous, with exotic timezone to avoid false negative",
"iso8601 -d '2019-04-25T21:42:54+0420' -S"),
make_test_group("2009-03-31 - 1 Month",
"iso8601 {fmt} -d '2009-03-31 01:00:00 +01:00' -D P-1M -E '2009-02-28 00:00:00Z'",
[Test, ValidatingTest]),
Expand Down