diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-12-09 20:53:02 -0800 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-12-10 10:16:05 -0800 |
commit | 01b7d5acc702df22d306ae95f1a9c3096e63e624 (patch) | |
tree | ec42028540f04653d1022a1ed83d509df77bd723 /test/ruby/test_exception.rb | |
parent | 4a559aa22537bbd2f17c7babb1aca48d1a3a4647 (diff) |
Remove the uninitialized instance variable verbose mode warning
This speeds up all instance variable access, even when not in
verbose mode. Uninitialized instance variable warnings were
rarely helpful, and resulted in slower code if you wanted to
avoid warnings when run in verbose mode.
Implements [Feature #17055]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3879
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r-- | test/ruby/test_exception.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 536a02925c..087bcda5ac 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -955,8 +955,8 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| end def test_warning_warn - warning = capture_warning_warn {@a} - assert_match(/instance variable @a not initialized/, warning[0]) + warning = capture_warning_warn {$asdfasdsda_test_warning_warn} + assert_match(/global variable `\$asdfasdsda_test_warning_warn' not initialized/, warning[0]) assert_equal(["a\nz\n"], capture_warning_warn {warn "a\n", "z"}) assert_equal([], capture_warning_warn {warn}) @@ -1040,7 +1040,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| end def test_warning_warn_super - assert_in_out_err(%[-W0], "#{<<~"{#"}\n#{<<~'};'}", [], /instance variable @a not initialized/) + assert_in_out_err(%[-W0], "#{<<~"{#"}\n#{<<~'};'}", [], /global variable `\$asdfiasdofa_test_warning_warn_super' not initialized/) {# module Warning def warn(message) @@ -1049,7 +1049,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| end $VERBOSE = true - @a + $asdfiasdofa_test_warning_warn_super }; end |