simplecov-ruby/simplecov

Enabling branch coverage results in "LocalJumpError: break from proc-closure" errors

gettalong opened this issue · 3 comments

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

  1. git clone git@github.com:gettalong/hexapdf.git
  2. gem install geom2d
  3. cd hexapdf
  4. rake -> This should not result in any error
  5. Enable branch coverage by adding enable_coverage :branch in test/test_helper.rb at line 7
  6. 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

i have this same issue calling break inside an each loop

This appears to be caused by https://bugs.ruby-lang.org/issues/18991

Works with Ruby 3.2.2 and simplecov 0.22.0., so issue closed.