diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-07 14:38:17 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-07 14:38:17 +0000 |
commit | f2f14f572d6fb92394955953352e6edb688cc986 (patch) | |
tree | 5c9ba4dad1d98cb1b01ce1b84c94d1c1b677fc63 /test/ruby | |
parent | 9c760d0aad3fac021dcfa7d7c80609cd4178d9c9 (diff) | |
download | ruby-f2f14f572d6fb92394955953352e6edb688cc986.tar.gz |
* time.c (rb_strftime_alloc): raise ERANGE if width is too large.
Patch by Nobuyoshi Nakada. [Bug #4457] [ruby-dev:43285]
* test/ruby/test_time.rb (class TestTime): add a test for the
above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_time.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 38e567a703..1f07a8249c 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -650,6 +650,9 @@ class TestTime < Test::Unit::TestCase # [ruby-core:33985] assert_equal("3000000000", Time.at(3000000000).strftime('%s')) + + bug4457 = '[ruby-dev:43285]' + assert_raise(Errno::ERANGE, bug4457) {Time.now.strftime('%8192z')} end def test_delegate |