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

* ext/date/date_core.c: [ruby-core:47226].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2012-08-22 10:42:15 +00:00
parent 69d6a825ae
commit 280681f40c
4 changed files with 17 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Wed Aug 22 19:41:19 2012 Tadayoshi Funaba <tadf@dotrb.org>
* ext/date/date_core.c: [ruby-core:47226].
Wed Aug 22 16:57:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (configuration): extact least ruby headers list as

View file

@ -7976,7 +7976,7 @@ dt_new_by_frags(VALUE klass, VALUE hash, VALUE sg)
set_hash("min", INT2FIX(0));
if (NIL_P(ref_hash("sec")))
set_hash("sec", INT2FIX(0));
else if (f_gt_p(ref_hash("sec"), INT2FIX(59)))
else if (f_eqeq_p(ref_hash("sec"), INT2FIX(60)))
set_hash("sec", INT2FIX(59));
}
else {

View file

@ -664,6 +664,12 @@ class TestDateParse < Test::Unit::TestCase
assert_raise(ArgumentError) do
DateTime.parse('2001-02-29T23:59:60')
end
assert_nothing_raised(ArgumentError) do
DateTime.parse('2001-03-01T23:59:60')
end
assert_raise(ArgumentError) do
DateTime.parse('2001-03-01T23:59:61')
end
assert_raise(ArgumentError) do
Date.parse('23:55')
end

View file

@ -467,6 +467,12 @@ class TestDateStrptime < Test::Unit::TestCase
assert_raise(ArgumentError) do
DateTime.strptime('2001-02-29T23:59:60', '%FT%T')
end
assert_nothing_raised(ArgumentError) do
DateTime.strptime('2001-03-01T23:59:60', '%FT%T')
end
assert_raise(ArgumentError) do
DateTime.strptime('2001-03-01T23:59:61', '%FT%T')
end
assert_raise(ArgumentError) do
Date.strptime('23:55', '%H:%M')
end