Skip to content

Commit 5a138af

Browse files
committed
Update tests
1 parent 2f7814c commit 5a138af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/date/test_date_parse.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,12 @@ def test__parse_odd_offset
587587

588588
def test__parse_too_long_year
589589
str = "Jan 1" + "0" * 100_000
590-
h = Timeout.timeout(1) {Date._parse(str)}
590+
h = Timeout.timeout(1) {Date._parse(str, limit: 100_010)}
591591
assert_equal(100_000, Math.log10(h[:year]))
592592
assert_equal(1, h[:mon])
593593

594594
str = "Jan - 1" + "0" * 100_000
595-
h = Timeout.timeout(1) {Date._parse(str)}
595+
h = Timeout.timeout(1) {Date._parse(str, limit: 100_010)}
596596
assert_equal(1, h[:mon])
597597
assert_not_include(h, :year)
598598
end
@@ -1309,6 +1309,5 @@ def test_length_limit
13091309
assert_raise(ArgumentError) { DateTime.jisx0301("1" * 1000) }
13101310

13111311
assert_raise(ArgumentError) { Date._parse("Jan " + "9" * 1000000) }
1312-
assert_raise(Timeout::Error) { Timeout.timeout(1) { Date._parse("Jan " + "9" * 1000000, limit: nil) } }
13131312
end
13141313
end

0 commit comments

Comments
 (0)