diff options
author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-13 00:41:10 +0000 |
---|---|---|
committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-13 00:41:10 +0000 |
commit | c67712ef6359707e32ebf2c6bcc27b9bbe3c532b (patch) | |
tree | e8ac0eace2c4e4f1386d3d6b73264dc9c38c3bf7 /test/date/test_switch_hitter.rb | |
parent | 14b57772ece1fa9c9f597d8fe39496f8a4d9088a (diff) | |
download | ruby-c67712ef6359707e32ebf2c6bcc27b9bbe3c532b.tar.gz |
* test/date/test_*.rb: added tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/date/test_switch_hitter.rb')
-rw-r--r-- | test/date/test_switch_hitter.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb index 6b1050d0ca..989d939bb2 100644 --- a/test/date/test_switch_hitter.rb +++ b/test/date/test_switch_hitter.rb @@ -218,6 +218,15 @@ class TestSH < Test::Unit::TestCase assert_equal(Encoding::US_ASCII, d.inspect.encoding) end + def test_strftime + assert_raise(Errno::ERANGE) do + Date.today.strftime('%100000z') + end + assert_raise(Errno::ERANGE) do + Date.new(1 << 10000).strftime('%Y') + end + end + def test_cmp assert_equal(-1, Date.new(2001,2,3) <=> Date.new(2001,2,4)) assert_equal(0, Date.new(2001,2,3) <=> Date.new(2001,2,3)) |