[ruby-core:90841] [Ruby trunk Bug#15476][Open] Branch coverage: Failing to load trivial sample when branch coverage is on

From: mame@...
Date: 2019-01-01 01:53:50 UTC
List: ruby-core #90841
Issue #15476 has been updated by mame (Yusuke Endoh).

Status changed from Closed to Open

Sorry, I wrote a wrong ticket number.

----------------------------------------
Bug #15476: Branch coverage: Failing to load trivial sample when branch coverage is on
https://bugs.ruby-lang.org/issues/15476#change-76028

* Author: MaxLap (Maxime Lapointe)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following will fail (for the second #load) on 2.6.0
I assume this is Ruby removing useless code, and the branch coverage code handling it incorrectly.

~~~ ruby
require 'tempfile'
f = Tempfile.new(['ruby', '.rb'])
f.write(<<-RUBY)
  nil&.map { |i| i }
RUBY
f.close

require 'coverage'

load f.path
puts 'Without coverage worked'
Coverage.start(branches: true)
load f.path
puts 'With coverage worked'
~~~

This problem was not present in 2.5, but appeared in 2.6




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next