зеркало из https://github.com/github/ruby.git
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:
Родитель
afc7be7570
Коммит
b67f65dbd6
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче