mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_rubyoptions.rb: assert_same to check identity
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
afc7be7570
commit
b67f65dbd6
1 changed files with 3 additions and 3 deletions
|
@ -571,14 +571,14 @@ class TestRubyOptimization < Test::Unit::TestCase
|
|||
def test_peephole_dstr
|
||||
code = "#{<<~'begin;'}\n#{<<~'end;'}"
|
||||
begin;
|
||||
exp = (-'a').object_id
|
||||
exp = -'a'
|
||||
z = 'a'
|
||||
exp == (-"#{z}").object_id
|
||||
[exp, -"#{z}"]
|
||||
end;
|
||||
[ false, true ].each do |fsl|
|
||||
iseq = RubyVM::InstructionSequence.compile(code,
|
||||
frozen_string_literal: fsl)
|
||||
assert_equal(true, iseq.eval,
|
||||
assert_same(*iseq.eval,
|
||||
"[ruby-core:85542] [Bug #14475] fsl: #{fsl}")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue