diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2022-06-20 19:25:11 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2022-06-20 19:25:11 +0900 |
commit | 15db2e9496703d76b2d785a9e2a1554833706e06 (patch) | |
tree | 88f28796def7caca06ddc46b21e3ff4adfd8817d /test | |
parent | f8b6d4f4d1b0eb0b3220fc83f157bd33ddcc5d4e (diff) | |
download | ruby-15db2e9496703d76b2d785a9e2a1554833706e06.tar.gz |
Prevent a warning "possibly useless use of a literal in void context"
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_ast.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 5cf7a7f1b5..d28d7e1fab 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -543,6 +543,9 @@ dummy end def test_encoding_with_keep_script_lines + # Stop a warning "possibly useless use of a literal in void context" + verbose_bak, $VERBOSE = $VERBOSE, nil + enc = Encoding::EUC_JP code = "__ENCODING__".encode(enc) @@ -553,6 +556,9 @@ dummy node = RubyVM::AbstractSyntaxTree.parse(code, keep_script_lines: true) assert_equal(enc, node.children[2].children[0]) + + ensure + $VERBOSE = verbose_bak end def test_e_option |