diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2022-10-12 21:48:28 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2022-10-12 21:48:28 +0900 |
commit | 9cfc45d6e52cf4ffde0375f8d3f2271c36e9e91c (patch) | |
tree | e6f14a061808c3852c7360632462a4bec1686a1f /test | |
parent | 7a9f865a1d855109c7990b5fee21f92cc951ce60 (diff) | |
download | ruby-9cfc45d6e52cf4ffde0375f8d3f2271c36e9e91c.tar.gz |
Suppress warnings in test/ruby/test_ast.rb
The tests for error tolerance printed some warnings. This change
suppresses them.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index b91880be6d..aaf626e801 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -568,6 +568,7 @@ dummy end def test_error_tolerant + verbose_bak, $VERBOSE = $VERBOSE, false node = RubyVM::AbstractSyntaxTree.parse(<<~STR, error_tolerant: true) class A def m @@ -579,6 +580,8 @@ dummy assert_nil($!) assert_equal(:SCOPE, node.type) + ensure + $VERBOSE = verbose_bak end def test_error_tolerant_end_is_short_for_method_define @@ -965,7 +968,12 @@ dummy end def assert_error_tolerant(src, expected) - node = RubyVM::AbstractSyntaxTree.parse(src, error_tolerant: true) + begin + verbose_bak, $VERBOSE = $VERBOSE, false + node = RubyVM::AbstractSyntaxTree.parse(src, error_tolerant: true) + ensure + $VERBOSE = verbose_bak + end assert_nil($!) str = "" PP.pp(node, str, 80) |