diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-09 11:33:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-09 11:33:46 +0000 |
commit | 00f97ed41a56f8146a8066db0934b574615b9760 (patch) | |
tree | df09566408ce070dc24021c320008928db5e3c63 /test/ruby | |
parent | 4eec1b31b90f89101a482600770df1faae041a13 (diff) | |
download | ruby-00f97ed41a56f8146a8066db0934b574615b9760.tar.gz |
* time.c (find_time_t): 24:00 should be the beginning of the next
day even if the leap second, 23:59:60, exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time_tz.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb index 4942d32028..e6b632f2dd 100644 --- a/test/ruby/test_time_tz.rb +++ b/test/ruby/test_time_tz.rb @@ -147,6 +147,23 @@ class TestTimeTZ < Test::Unit::TestCase } end + def test_right_utc + with_tz(tz="right/UTC") { + assert_time_constructor(tz, "2008-12-31 23:59:59 UTC", :utc, [2008,12,31,23,59,59]) + assert_time_constructor(tz, "2008-12-31 23:59:60 UTC", :utc, [2008,12,31,23,59,60]) + assert_time_constructor(tz, "2009-01-01 00:00:00 UTC", :utc, [2008,12,31,24,0,0]) + assert_time_constructor(tz, "2009-01-01 00:00:00 UTC", :utc, [2009,1,1,0,0,0]) + } + end + + def test_right_america_los_angeles + with_tz(tz="right/America/Los_Angeles") { + assert_time_constructor(tz, "2008-12-31 15:59:59 -0800", :local, [2008,12,31,15,59,59]) + assert_time_constructor(tz, "2008-12-31 15:59:60 -0800", :local, [2008,12,31,15,59,60]) + assert_time_constructor(tz, "2008-12-31 16:00:00 -0800", :local, [2008,12,31,16,0,0]) + } + end + MON2NUM = { "Jan" => 1, "Feb" => 2, "Mar" => 3, "Apr" => 4, "May" => 5, "Jun" => 6, "Jul" => 7, "Aug" => 8, "Sep" => 9, "Oct" => 10, "Nov" => 11, "Dec" => 12 |