summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
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")
}