summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 07:07:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-20 07:07:35 +0000
commit314bef7ef149d7ce87c57fa0c95e30fc8fb9b27f (patch)
tree0d4ec9f1e50ea5fb278260d7ac8517210761df6e /bootstraptest
parente42fac7c061283180cbc630bd930ef16f5074d33 (diff)
* insnhelper.ci, vm.c, vm_core.h: change interface of
vm_invoke_block() to specify block ptr. [ruby-talk:266422] * cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c: apply above change. * bootstraptest/test_knownbug.rb: move fixed bug. * bootstraptest/test_block.rb: ditto. and add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_block.rb25
-rw-r--r--bootstraptest/test_knownbug.rb21
2 files changed, 25 insertions, 21 deletions
diff --git a/bootstraptest/test_block.rb b/bootstraptest/test_block.rb
index 97fcdd4bef..f139c21d15 100644
--- a/bootstraptest/test_block.rb
+++ b/bootstraptest/test_block.rb
@@ -472,3 +472,28 @@ assert_equal '[nil, []]', %q{
GC.stress=false
r.inspect
}, '[ruby-dev:32567]'
+
+assert_equal NilClass.to_s, %q{
+ r = false; 1.times{|&b| r = b}; r.class
+}
+
+assert_equal 'ok', %q{
+ class C
+ define_method(:foo) do |arg, &block|
+ if block then block.call else arg end
+ end
+ end
+ C.new.foo("ng") {"ok"}
+}, '[ruby-talk:266422]'
+
+assert_equal 'ok', %q{
+ STDERR.reopen(STDOUT)
+ class C
+ define_method(:foo) do |&block|
+ block.call if block
+ end
+ result = "ng"
+ new.foo() {result = "ok"}
+ result
+ end
+}
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb
index 2108a59168..c9711d642f 100644
--- a/bootstraptest/test_knownbug.rb
+++ b/bootstraptest/test_knownbug.rb
@@ -11,27 +11,6 @@ assert_equal '0', %q{
}, '[ruby-dev:32404]'
assert_equal 'ok', %q{
- class C
- define_method(:foo) do |arg, &block|
- if block then block.call else arg end
- end
- end
- C.new.foo("ng") {"ok"}
-}, '[ruby-talk:266422]'
-
-assert_equal 'ok', %q{
- STDERR.reopen(STDOUT)
- class C
- define_method(:foo) do |&block|
- block.call if block
- end
- result = "ng"
- new.foo() {result = "ok"}
- result
- end
-}
-
-assert_equal 'ok', %q{
1.times{
eval("break")
}