1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Test invalid offset warnings

This commit is contained in:
Nobuyoshi Nakada 2019-07-24 01:42:05 +09:00
parent f295e23e54
commit afea8db8c7
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -186,13 +186,16 @@ class TestDateStrftime < Test::Unit::TestCase
(-24..24).collect{|x| '%+.2d' % x}.each do |hh|
%w(00 30).each do |mm|
r = hh + mm
if r[-4,4] == '2430'
r = '+0000'
end
next if r.end_with?('2430')
d = DateTime.parse(s + hh + mm)
assert_equal(r, d.strftime('%z'))
end
end
%w[+2430 -2430].each do |r|
assert_warning(/invalid offset/) do
DateTime.parse(s + r)
end
end
end
def test_strftime_milli