From fa2e4a2061e140ce980bd2c8faef0d63bb408100 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 31 Dec 2017 13:01:55 +0000 Subject: error.c: negative uplevel * error.c (rb_warn_m): negative uplevel is not allowed. [ruby-core:84568] [Bug #14262] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_exception.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test/ruby') diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 76be7f0ac2..212a52f24a 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1007,6 +1007,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| def test_kernel_warn_uplevel warning = capture_warning_warn {warn("test warning", uplevel: 0)} assert_equal("#{__FILE__}:#{__LINE__-1}: warning: test warning\n", warning[0]) + assert_raise(ArgumentError) {warn("test warning", uplevel: -1)} end def test_warning_warn_invalid_argument -- cgit v1.2.3