summaryrefslogtreecommitdiff
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-05-10 17:05:12 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:35 -0400
commit7eef8f09c09d054b0554a304456a0bbd9df40d86 (patch)
tree7ab1742634d462f41e7db9f79c0dee9f2d8148c4 /bootstraptest
parentce928473d054b3fcbe2b05a1432b770dccd54bef (diff)
Implement getblockparamproxy
* Implement getblockparamproxy * Parallel runner: wait for timeout thread to terminate after killing Or else the leak cheaker could sees the thread as running and cause test failures in test-tool. * Add a comment, use jne * Comment about where 0x3 comes from
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb50
1 files changed, 37 insertions, 13 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index abbe40e9e7..524b387502 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -858,26 +858,50 @@ assert_equal 'raised', %q{
# test calling Ruby method with a block
assert_equal '[1, 2, 42]', %q{
-def thing(a, b)
- [a, b, yield]
-end
+ def thing(a, b)
+ [a, b, yield]
+ end
-def use
- thing(1,2) { 42 }
-end
+ def use
+ thing(1,2) { 42 }
+ end
-use
-use
+ use
+ use
}
# test calling C method with a block
assert_equal '[42, 42]', %q{
-def use(array, initial)
- array.reduce(initial) { |a, b| a + b }
-end
+ def use(array, initial)
+ array.reduce(initial) { |a, b| a + b }
+ end
+
+ use([], 0)
+ [use([2, 2], 38), use([14, 14, 14], 0)]
+}
+
+# test calling block param
+assert_equal '[1, 2, 42]', %q{
+ def foo(&block)
+ block.call
+ end
-use([], 0)
-[use([2, 2], 38), use([14, 14, 14], 0)]
+ [foo {1}, foo {2}, foo {42}]
+}
+
+# test calling block param failing
+assert_equal '42', %q{
+ def foo(&block)
+ block.call
+ end
+
+ foo {} # warmup
+
+ begin
+ foo
+ rescue NoMethodError => e
+ 42 if nil == e.receiver
+ end
}
# test calling method taking block param