diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-05-10 17:05:12 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:35 -0400 |
commit | 7eef8f09c09d054b0554a304456a0bbd9df40d86 (patch) | |
tree | 7ab1742634d462f41e7db9f79c0dee9f2d8148c4 /bootstraptest | |
parent | ce928473d054b3fcbe2b05a1432b770dccd54bef (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.rb | 50 |
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 |