Skip to content

Some branches are not covered if the type of a default argument is Long. #907

@eungjun-yi

Description

@eungjun-yi

Steps to reproduce

JaCoCo version: 0.8.5-SNAPSHOT
Operating system: Linux pop-os 5.0.0-20-generic
Tool integration: gradle

Test this production code:

data class Foo(val x: Long = 0)

by this test:

class FooTest {

    @Test
    fun test() {
        assertEquals(1, Foo(1).x)
        assertEquals(0, Foo().x)
    }
}

Expected behaviour

All instructions and branches are covered

Actual behaviour

All instructions are covered but 50% of branches are NOT covered.

image

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions