summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmitrii Zudin <[email protected]>2024-09-21 23:37:07 +0300
committergit <[email protected]>2024-11-05 03:38:13 +0000
commitee4599dbe7e49a242a1e8170b0439cfb0130ad98 (patch)
treef984017e48902a80ef2f644115a5e556712121cc /test
parente0611ebd9a4c05a9c16a1da8e5c3081f7890ea8c (diff)
[ruby/date] Fix incorrect argc2 decrement in datetime_s_iso8601 function
Replace the decrement (argc2--) with an increment (argc2++) for the correct number of arguments when opt is provided. https://github.com/ruby/date/commit/b6974b00d8
Diffstat (limited to 'test')
-rw-r--r--test/date/test_date_strftime.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb
index dd04c0d9a4..976e48f517 100644
--- a/test/date/test_date_strftime.rb
+++ b/test/date/test_date_strftime.rb
@@ -412,6 +412,14 @@ class TestDateStrftime < Test::Unit::TestCase
assert_equal('H31.04.30', Date.parse('2019-04-30').jisx0301)
assert_equal('R01.05.01', Date.parse('2019-05-01').jisx0301)
+ assert_equal(d2, DateTime.iso8601('2001-02-03T04:05:06.123456+00:00', limit: 64))
+ assert_equal(d2, DateTime.rfc3339('2001-02-03T04:05:06.123456+00:00', limit: 64))
+ assert_equal(d2, DateTime.jisx0301('H13.02.03T04:05:06.123456+00:00', limit: 64))
+
+ assert_raise(ArgumentError) { DateTime.iso8601('2001-02-03T04:05:06.123456+00:00', limit: 1) }
+ assert_raise(ArgumentError) { DateTime.rfc3339('2001-02-03T04:05:06.123456+00:00', limit: 1) }
+ assert_raise(ArgumentError) { DateTime.jisx0301('H13.02.03T04:05:06.123456+00:00', limit: 1) }
+
%w(M06.01.01
M45.07.29
T01.07.30