mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Prevent a warning "possibly useless use of a literal in void context"
This commit is contained in:
parent
f8b6d4f4d1
commit
15db2e9496
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue