summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 1fb1c24cf3..6d2a6cde95 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -1078,6 +1078,22 @@ class ITER_TEST2 < ITER_TEST1
end
test_ok(ITER_TEST2.new.a {})
+class ITER_TEST3
+ def foo x
+ return yield if block_given?
+ x
+ end
+end
+
+class ITER_TEST4 < ITER_TEST3
+ def foo x
+ test_ok(super == yield)
+ test_ok(super(x, &nil) == x)
+ end
+end
+
+ITER_TEST4.new.foo(44){55}
+
test_check "float"
test_ok(2.6.floor == 2)
test_ok((-2.6).floor == -3)