-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
In Julia v1.10.6, the code below gets 100% coverage. In Julia v1.11.1, foo is not marked as covered.
src/Example.jl:
module Example
export foo, bar
function foo(x) end # covered in v1.10 but not covered in v1.11
function bar(x; o=1) end # covered in both versions
endtest/runtests.jl:
using Example, Test
@test isnothing(foo(1))
@test isnothing(bar(1))I understand that this package uses a workaround to mark lines as code that then may not be marked as covered. Indeed, with DISABLE_AMEND_COVERAGE_FROM_SRC=yes, I get full coverage in v1.11.
Based on that, I presume the explanation here is that the compiler optimizes foo out, while bar has a default parameter and somehow gets tracked anyway.
But I am surprised to see this change when switching between Julia versions. My questions are:
- Is this intended behavior?
- Is there a way to get full coverage back in v1.11 without setting the environment variable?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels