summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 19:59:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-26 19:59:08 +0000
commit6e33c16ffdabf6b8c64a49344f830a25a2b5bccf (patch)
tree2a72df6eb1bddd05d1130606bb900f98af477adf /test/ruby
parentd35bfdac74ceae1c70781667a1efc3378163fe1b (diff)
downloadruby-6e33c16ffdabf6b8c64a49344f830a25a2b5bccf.tar.gz
Give up support for cross-callcc set_trace_func.
* cont.c (cont_restore_thread): cause error if trace-status is changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_continuation.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb
index a06ac98c8c..8c62d20840 100644
--- a/test/ruby/test_continuation.rb
+++ b/test/ruby/test_continuation.rb
@@ -88,11 +88,16 @@ class TestContinuation < Test::Unit::TestCase
@memo += 1
c = cont
cont = nil
- c.call(nil)
+ begin
+ c.call(nil)
+ rescue RuntimeError
+ set_trace_func(nil)
+ end
end
end
end
cont = callcc { |cc| cc }
+
if cont
set_trace_func(func)
else
@@ -100,12 +105,12 @@ class TestContinuation < Test::Unit::TestCase
end
end
- def test_tracing_with_set_trace_func
+ def _test_tracing_with_set_trace_func
@memo = 0
tracing_with_set_trace_func
tracing_with_set_trace_func
tracing_with_set_trace_func
- assert_equal 3, @memo
+ assert_equal 0, @memo
end
def tracing_with_thread_set_trace_func
@@ -115,7 +120,11 @@ class TestContinuation < Test::Unit::TestCase
@memo += 1
c = cont
cont = nil
- c.call(nil)
+ begin
+ c.call(nil)
+ rescue RuntimeError
+ Thread.current.set_trace_func(nil)
+ end
end
end
cont = callcc { |cc| cc }