Convert time component strings to integers more strictly

https://bugs.ruby-lang.org/issues/17485#change-89871
This commit is contained in:
Nobuyoshi Nakada 2021-01-12 17:24:43 +09:00
parent b017848f8a
commit 1eb8eb55c2
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 5 additions and 4 deletions

View file

@ -46,6 +46,7 @@ class TestTime < Test::Unit::TestCase
t = Time.new(*tm, "-12:00")
assert_equal([2001,2,28,23,59,30,-43200], [t.year, t.month, t.mday, t.hour, t.min, t.sec, t.gmt_offset], bug4090)
assert_raise(ArgumentError) { Time.new(2000,1,1, 0,0,0, "+01:60") }
assert_raise(ArgumentError) { Time.new(2021, 1, 1, "+09:99") }
end
def test_time_add()