Use assert_separately instead of invoke_ruby

This commit is contained in:
Nobuyoshi Nakada 2019-06-28 15:25:12 +09:00
parent e0c4cb2ea1
commit 11571b0e95
No known key found for this signature in database
GPG Key ID: 4BC7D6DF58D8DF60

View File

@ -1903,16 +1903,19 @@ class TestSetTraceFunc < Test::Unit::TestCase
end end
def test_lineno_in_optimized_insn def test_lineno_in_optimized_insn
actual, _, _ = EnvUtil.invoke_ruby %W[-W0], <<-EOF.gsub(/^.*?: */, ""), true assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
1: class String begin;
2: def -@ $loc = nil
3: puts caller_locations(1, 1)[0].lineno class String
4: end undef -@
5: end def -@
6: $loc = caller_locations(1, 1)[0].lineno
7: -"" end
EOF end
assert_equal "7\n", actual, '[Bug #14809]'
assert_predicate(-"", :frozen?)
assert_equal(__LINE__-1, $loc, '[Bug #14809]')
end;
end end
def method_for_enable_target1 def method_for_enable_target1