diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ext/date/date_core.c | 2 | ||||
-rw-r--r-- | test/date/test_switch_hitter.rb | 2 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 10 insertions, 4 deletions
@@ -1,3 +1,7 @@ +Tue May 27 11:23:02 2014 Tadayoshi Funaba <tadf@dotrb.org> + + * ext/date/date_core.c (d_lite_cmp): should compare with #<. + Mon May 5 00:42:35 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> * ext/psych/yaml/config.h: ditto. diff --git a/ext/date/date_core.c b/ext/date/date_core.c index e5aa4df171..e3e6c4c2ae 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -6303,7 +6303,7 @@ d_lite_cmp(VALUE self, VALUE other) return INT2FIX(1); } } - else if (a_nth < b_nth) { + else if (f_lt_p(a_nth, b_nth)) { return INT2FIX(-1); } else { diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb index f18d76b393..08e23015dc 100644 --- a/test/date/test_switch_hitter.rb +++ b/test/date/test_switch_hitter.rb @@ -312,6 +312,8 @@ class TestSH < Test::Unit::TestCase assert_equal(-1, Date.new(2001,2,3) <=> Rational('4903888/2')) assert_equal(0, Date.new(2001,2,3) <=> Rational('4903887/2')) assert_equal(1, Date.new(2001,2,3) <=> Rational('4903886/2')) + + assert_equal(-1, Date.new(-4713,11,1,Date::GREGORIAN) <=> Date.new(-4713,12,1,Date::GREGORIAN)) end def test_eqeqeq @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.0.0" -#define RUBY_RELEASE_DATE "2014-05-08" -#define RUBY_PATCHLEVEL 481 +#define RUBY_RELEASE_DATE "2014-05-27" +#define RUBY_PATCHLEVEL 482 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 8 +#define RUBY_RELEASE_DAY 27 #include "ruby/version.h" |