Issue #14191 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to mame (Yusuke Endoh)
Target version set to 2.5

Thank you for the report!

I found that #14104 changed TracePoint's lineno, which broke coverage.so.  I'll fix it with ko1.

----------------------------------------
Bug #14191: Coverage decreased between 2.4.3 and 2.5.0rc1
https://bugs.ruby-lang.org/issues/14191#change-68453

* Author: kddeisz (Kevin Deisz)
* Status: Assigned
* Priority: Normal
* Assignee: mame (Yusuke Endoh)
* Target version: 2.5
* ruby -v: 2.5.0rc1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Just ran the test suite on my Rails app on the new rc and noticed that the coverage dropped by a full 3%. After some investigation discovered a lot of lines aren't being reported as covered anymore even though they clearly are. Here are all of the instances that I found that don't report coverage when they should:

~~~ ruby
# test.rb
require 'coverage'
Coverage.start

require_relative './file.rb'
p Coverage.result
~~~

~~~ruby
# file.rb
FOO = [
  { foo: 'bar' },
  { bar: 'baz' }
]

'some string'.split
             .map(&:length)

some =
  'value'

Struct.new(
  :foo,
  :bar
).new

class Test
  def foo(bar)
    {
      foo: bar
    }
  end
end

Test.new.foo(Object.new)
~~~

In this case we're not getting coverage on the constant assignment, on the second method of the string manipulation, on the multi-line assignment, on the instantiation of the struct, or on the return value of the Test#foo method.



-- 
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>