[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:106242] [Ruby master Bug#16776] Regression in coverage library
From:
"hsbt (Hiroshi SHIBATA)" <noreply@...>
Date:
2021-11-24 05:33:55 UTC
List:
ruby-core #106242
Issue #16776 has been updated by hsbt (Hiroshi SHIBATA).
Assignee set to mame (Yusuke Endoh)
Status changed from Open to Assigned
----------------------------------------
Bug #16776: Regression in coverage library
https://bugs.ruby-lang.org/issues/16776#change-94862
* Author: deivid (David Rodr鱈guez)
* Status: Assigned
* Priority: Normal
* Assignee: mame (Yusuke Endoh)
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Hi!
I noticed a regression in the coverage library. I tried to write a minimal program to show it, hopefully it gives some clues or where the issue might lie.
In ruby 2.5.8 and earlier, the following program would print `{:lines=>[1, 1, nil]}`, showing that the body of the "foo" method was run once. However, on newer rubies, it prints `{:lines=>[1, 0, nil]}`, which is incorrect because the "foo" method body has actually been run once.
This is the repro script:
```ruby
# frozen_string_literal: true
require "coverage"
Coverage.start(lines: true)
code = <<~RUBY
def foo
"LOL"
end
RUBY
File.open("foo.rb", "w") { |f| f.write(code) }
require_relative "foo"
TracePoint.new(:line) do |_tp|
foo
end.enable do
sleep 0
end
res = Coverage.result
puts res[File.expand_path("foo.rb")]
```
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>