Project

General

Profile

Bug #8679 » draft.utc_offset_arg.patch

example-utc_offset_arg.patch - kachick (Kenichi Kamiya), 07/24/2013 06:05 PM

View differences:

test/ruby/test_time.rb
tm = [2001,2,28,23,59,30]
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") }
end
def test_time_add()
time.c
if (!ISDIGIT(s[1]) || !ISDIGIT(s[2])) goto invalid_utc_offset;
if (s[3] != ':') goto invalid_utc_offset;
if (!ISDIGIT(s[4]) || !ISDIGIT(s[5])) goto invalid_utc_offset;
if (s[4] > '5') goto invalid_utc_offset;
break;
default:
goto invalid_utc_offset;
    (1-1/1)