ruby-changes:72253
From: Yusuke <ko1@a...>
Date: Mon, 20 Jun 2022 19:25:34 +0900 (JST)
Subject: [ruby-changes:72253] 15db2e9496 (master): Prevent a warning "possibly useless use of a literal in void context"
https://git.ruby-lang.org/ruby.git/commit/?id=15db2e9496 From 15db2e9496703d76b2d785a9e2a1554833706e06 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Mon, 20 Jun 2022 19:25:11 +0900 Subject: Prevent a warning "possibly useless use of a literal in void context" --- test/ruby/test_ast.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L543 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L556 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/