diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-22 10:42:15 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-08-22 10:42:15 +0000 |
commit | 280681f40c8f3096fd4d7766fb1818ae67437687 (patch) | |
tree | 66969f77ddcf0d84e8c2c7f3d120cca9f6c4f60d | |
parent | 69d6a825ae87300af604d9306800d5998300d4f5 (diff) | |
download | ruby-280681f40c8f3096fd4d7766fb1818ae67437687.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ext/date/date_core.c | 2 | ||||
-rw-r--r-- | test/date/test_date_parse.rb | 6 | ||||
-rw-r--r-- | test/date/test_date_strptime.rb | 6 |
4 files changed, 17 insertions, 1 deletions
@@ -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 diff --git a/ext/date/date_core.c b/ext/date/date_core.c index 762a0b7472..3a2fbb28d8 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -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 { diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb index 1504473938..f2cfb6f8e6 100644 --- a/test/date/test_date_parse.rb +++ b/test/date/test_date_parse.rb @@ -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 diff --git a/test/date/test_date_strptime.rb b/test/date/test_date_strptime.rb index ceb649031f..1924c4b78e 100644 --- a/test/date/test_date_strptime.rb +++ b/test/date/test_date_strptime.rb @@ -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 |