summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-21 11:42:50 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-21 11:42:50 +0000
commit5b16ddf5047aa508316e7687fafd1e4870f2d687 (patch)
treee1a0f319671939c19ba0c8cc6690b8ab7596683f /test
parentc9aef84c7a3c075b05a89c8f9737369f7f6c2303 (diff)
* ext/date/date_core.c (datetime_s_*): canonicalize 24 o'clock.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/date/test_switch_hitter.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb
index 5ec94fd8e1..4294a21e9d 100644
--- a/test/date/test_switch_hitter.rb
+++ b/test/date/test_switch_hitter.rb
@@ -180,6 +180,21 @@ class TestSH < Test::Unit::TestCase
[d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
end
+ def test_canon24oc
+ d = DateTime.jd(2451943,24)
+ assert_equal([2001, 2, 3, 0, 0, 0, 0],
+ [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
+ d = DateTime.ordinal(2001,33,24)
+ assert_equal([2001, 2, 3, 0, 0, 0, 0],
+ [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
+ d = DateTime.new(2001,2,2,24)
+ assert_equal([2001, 2, 3, 0, 0, 0, 0],
+ [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
+ d = DateTime.commercial(2001,5,5,24)
+ assert_equal([2001, 2, 3, 0, 0, 0, 0],
+ [d.year, d.mon, d.mday, d.hour, d.min, d.sec, d.offset])
+ end
+
def test_zone
d = Date.new(2001, 2, 3)
assert_equal(Encoding::US_ASCII, d.send(:zone).encoding)