summaryrefslogtreecommitdiff
path: root/test/date/test_switch_hitter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/date/test_switch_hitter.rb')
-rw-r--r--test/date/test_switch_hitter.rb9
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))