summaryrefslogtreecommitdiff
path: root/test/test_time.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-24 11:34:45 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-24 11:34:45 +0000
commit54370de9f4c01ba43752057b602bafc5be293665 (patch)
treea1843c45a65e1050416769821b4fa8eb3c5cc07e /test/test_time.rb
parentdb1564ec1d48dd2e898c7ca11eed523e92c78f46 (diff)
* 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.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_time.rb b/test/test_time.rb
index 2a22c60..7cb75ab 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