diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-11-24 18:05:12 +0900 |
---|---|---|
committer | git <[email protected]> | 2022-02-25 19:52:32 +0900 |
commit | 4933d7fe565c5815febabf16603a9148abcf88d6 (patch) | |
tree | ccd4c33544db4e8031cf193734632d11883ee600 /test/date/test_date_parse.rb | |
parent | b5c2a0840f4dd8b44e0f82cda7a7f225d0a816ef (diff) |
[ruby/date] Update tests
https://github.com/ruby/date/commit/5a138afce9
Diffstat (limited to 'test/date/test_date_parse.rb')
-rw-r--r-- | test/date/test_date_parse.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb index 8876104f11..9a03ca8314 100644 --- a/test/date/test_date_parse.rb +++ b/test/date/test_date_parse.rb @@ -587,12 +587,12 @@ class TestDateParse < Test::Unit::TestCase def test__parse_too_long_year str = "Jan 1" + "0" * 100_000 - h = Timeout.timeout(1) {Date._parse(str)} + h = Timeout.timeout(1) {Date._parse(str, limit: 100_010)} assert_equal(100_000, Math.log10(h[:year])) assert_equal(1, h[:mon]) str = "Jan - 1" + "0" * 100_000 - h = Timeout.timeout(1) {Date._parse(str)} + h = Timeout.timeout(1) {Date._parse(str, limit: 100_010)} assert_equal(1, h[:mon]) assert_not_include(h, :year) end @@ -1309,6 +1309,5 @@ class TestDateParse < Test::Unit::TestCase assert_raise(ArgumentError) { DateTime.jisx0301("1" * 1000) } assert_raise(ArgumentError) { Date._parse("Jan " + "9" * 1000000) } - assert_raise(Timeout::Error) { Timeout.timeout(1) { Date._parse("Jan " + "9" * 1000000, limit: nil) } } end end |