diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-07-09 07:21:27 +0900 |
---|---|---|
committer | git <[email protected]> | 2022-02-25 19:52:31 +0900 |
commit | b5c2a0840f4dd8b44e0f82cda7a7f225d0a816ef (patch) | |
tree | 3b8548b45120c8092d903660a44d8823b637d456 /test/date/test_date_parse.rb | |
parent | 1758eade579c91f9ad000943994fccf30c7bf8a0 (diff) |
[ruby/date] Anchor at beginning of numbers
https://hackerone.com/reports/1254844
https://github.com/ruby/date/commit/2f7814cc22
Diffstat (limited to 'test/date/test_date_parse.rb')
-rw-r--r-- | test/date/test_date_parse.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb index a87b165080..8876104f11 100644 --- a/test/date/test_date_parse.rb +++ b/test/date/test_date_parse.rb @@ -590,6 +590,11 @@ class TestDateParse < Test::Unit::TestCase h = Timeout.timeout(1) {Date._parse(str)} 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)} + assert_equal(1, h[:mon]) + assert_not_include(h, :year) end require 'time' |