Use assert_separately instead of invoke_ruby
This commit is contained in:
parent
e0c4cb2ea1
commit
11571b0e95
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user