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 | 0d0095a5386b1abc1678a00ddf6633af4290cfb8 (patch) | |
tree | a1843c45a65e1050416769821b4fa8eb3c5cc07e /test | |
parent | ad40af58af0f487e0230b6ec0f36b261360b7ba8 (diff) | |
download | ruby-0d0095a5386b1abc1678a00ddf6633af4290cfb8.tar.gz ruby-0d0095a5386b1abc1678a00ddf6633af4290cfb8.tar.xz ruby-0d0095a5386b1abc1678a00ddf6633af4290cfb8.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@25906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 2a22c6069..7cb75ab6c 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 |