Enabling branch coverage results in "LocalJumpError: break from proc-closure" errors
gettalong opened this issue · 3 comments
gettalong commented
I tried enabling branch coverage in my test suite for HexaPDF. Once I do this there are multiple errors of the form "LocalJumpError: break from proc-closure". Without branch coverage everything is working fine.
The place where this error happens is always the same: https://github.com/gettalong/hexapdf/blob/master/lib/hexapdf/type/acro_form/form.rb#L151
How to reproduce
git clone git@github.com:gettalong/hexapdf.git
gem install geom2d
cd hexapdf
rake
-> This should not result in any error- Enable branch coverage by adding
enable_coverage :branch
intest/test_helper.rb
at line 7 rake
-> Now there should be 11 errors.
More Information
ruby -e "puts RUBY_DESCRIPTION
-> ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-linux]- Running the latest simplecov version 0.21.2
jakeonfire commented
i have this same issue calling break
inside an each
loop
ziggythehamster commented
This appears to be caused by https://bugs.ruby-lang.org/issues/18991
gettalong commented
Works with Ruby 3.2.2 and simplecov 0.22.0., so issue closed.