Skip to content

Commit

Permalink
Prevent a warning "possibly useless use of a literal in void context"
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Jun 20, 2022
1 parent f8b6d4f commit 15db2e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/ruby/test_ast.rb
Expand Up @@ -543,6 +543,9 @@ def test_keep_script_lines_for_of
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)

Expand All @@ -553,6 +556,9 @@ def test_encoding_with_keep_script_lines

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
Expand Down

0 comments on commit 15db2e9

Please sign in to comment.