diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-24 11:34:45 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-24 11:34:45 +0000 |
commit | 54370de9f4c01ba43752057b602bafc5be293665 (patch) | |
tree | a1843c45a65e1050416769821b4fa8eb3c5cc07e /test/test_time.rb | |
parent | db1564ec1d48dd2e898c7ca11eed523e92c78f46 (diff) | |
download | ruby-54370de9f4c01ba43752057b602bafc5be293665.tar.gz |
* strftime.c: %Y format a year with 4 digits at least.
* lib/time.rb: format a year with 4 digits at least.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_time.rb')
-rw-r--r-- | test/test_time.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb index 2a22c6069f..7cb75ab6c8 100644 --- a/test/test_time.rb +++ b/test/test_time.rb @@ -188,6 +188,15 @@ class TestTimeExtension < Test::Unit::TestCase # :nodoc: end assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec) + + assert_equal("10000-01-01T00:00:00Z", Time.utc(10000).xmlschema) + assert_equal("9999-01-01T00:00:00Z", Time.utc(9999).xmlschema) + assert_equal("0001-01-01T00:00:00Z", Time.utc(1).xmlschema) # 1 AD + assert_equal("0000-01-01T00:00:00Z", Time.utc(0).xmlschema) # 1 BC + assert_equal("-0001-01-01T00:00:00Z", Time.utc(-1).xmlschema) # 2 BC + assert_equal("-0004-01-01T00:00:00Z", Time.utc(-4).xmlschema) # 5 BC + assert_equal("-9999-01-01T00:00:00Z", Time.utc(-9999).xmlschema) + assert_equal("-10000-01-01T00:00:00Z", Time.utc(-10000).xmlschema) end def test_completion |