diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-27 17:14:13 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-27 17:14:13 +0000 |
commit | f0aa9838a23bba3abe411df12070fddc23775a82 (patch) | |
tree | 258ad19703416337dfcf605ee8e0dfa024764206 /test/ruby | |
parent | 7f9b9fbae8b0c588535af9247188d002d50ca850 (diff) | |
download | ruby-f0aa9838a23bba3abe411df12070fddc23775a82.tar.gz |
* time.c: fix previos commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 6ccac25553..5543951778 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -162,6 +162,16 @@ class TestTime < Test::Unit::TestCase assert_equal(999999998, Time.at(-14e-10).nsec) assert_equal(999999998, Time.at(-16e-10).nsec) end + + t = Time.at(-4611686019).utc + assert_equal(1823, t.year) + + t = Time.at(4611686018, 999999).utc + assert_equal(2116, t.year) + assert_equal("0.999999".to_r, t.subsec) + + t = Time.at(2**40 + "1/3".to_r, 9999999999999).utc + assert_equal(36812, t.year) end def test_at2 @@ -287,6 +297,9 @@ class TestTime < Test::Unit::TestCase t = Time.local(2000) assert_equal(t.gmt_offset, T2000 - t) + + assert_equal(-4427700000, Time.utc(-4427700000,12,1).year) + assert_equal(-2**30+10, Time.utc(-2**30+10,1,1).year) end def test_time_interval @@ -407,6 +420,11 @@ class TestTime < Test::Unit::TestCase assert_equal(Rational(1,3), (t0 + SimpleDelegator.new(Rational(4,3))).subsec) end + def test_minus + t = Time.at(-4611686018).utc - 100 + assert_equal(1823, t.year) + end + def test_readers assert_equal(0, T2000.sec) assert_equal(0, T2000.min) |