diff --git a/ext/date/date_core.c b/ext/date/date_core.c index fa00cbdcb7..ccac90a32e 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -6574,8 +6574,11 @@ static VALUE mk_inspect(union DateData *x, VALUE klass, VALUE to_s) { return rb_enc_sprintf(rb_usascii_encoding(), - "#<%"PRIsVALUE": %"PRIsVALUE">", - klass, to_s); + "#<%"PRIsVALUE": %"PRIsVALUE" " + "((%+"PRIsVALUE"j,%ds,%+"PRIsVALUE"n),%+ds,%.0fj)>", + klass, to_s, + m_real_jd(x), m_df(x), m_sf(x), + m_of(x), m_sg(x)); } /* diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb index 5c5a1bb0e6..bdf299e030 100644 --- a/test/date/test_switch_hitter.rb +++ b/test/date/test_switch_hitter.rb @@ -282,10 +282,8 @@ class TestSH < Test::Unit::TestCase def test_inspect d = Date.new(2001, 2, 3) assert_equal(Encoding::US_ASCII, d.inspect.encoding) - assert_equal('#', d.inspect) d = DateTime.new(2001, 2, 3) assert_equal(Encoding::US_ASCII, d.inspect.encoding) - assert_equal('#', d.inspect) end def test_strftime