ruby-changes:56256
From: Nobuyoshi <ko1@a...>
Date: Fri, 28 Jun 2019 15:30:23 +0900 (JST)
Subject: [ruby-changes:56256] Nobuyoshi Nakada: 11571b0e95 (trunk): Use assert_separately instead of invoke_ruby
https://git.ruby-lang.org/ruby.git/commit/?id=11571b0e95 From 11571b0e95346691e634781f281b92c75608955c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 28 Jun 2019 15:25:12 +0900 Subject: Use assert_separately instead of invoke_ruby diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 74aae0a..efd3318 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1903,16 +1903,19 @@ class TestSetTraceFunc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L1903 end def test_lineno_in_optimized_insn - actual, _, _ = EnvUtil.invoke_ruby %W[-W0], <<-EOF.gsub(/^.*?: */, ""), true - 1: class String - 2: def -@ - 3: puts caller_locations(1, 1)[0].lineno - 4: end - 5: end - 6: - 7: -"" - EOF - assert_equal "7\n", actual, '[Bug #14809]' + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + $loc = nil + class String + undef -@ + def -@ + $loc = caller_locations(1, 1)[0].lineno + end + end + + assert_predicate(-"", :frozen?) + assert_equal(__LINE__-1, $loc, '[Bug #14809]') + end; end def method_for_enable_target1 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/