Skip to content

Weird coverage behavior with Kotlin .trim() #754

@bootstraponline

Description

@bootstraponline

Steps to reproduce

JaCoCo version: 0.8.2
Operating system: macOS High Sierra 10.13.6
Tool integration: Gradle

Run JaCoCo using gradle on this Kotlin code:

    fun returnString(): String {
        return "string"
    }

    fun coverage1() {
        returnString().trim()
    }

    fun coverage2() {
        returnString()
    }

Here's the code for Kotlin's trim() method:

/**
 * Returns a string having leading and trailing whitespace removed.
 */
@kotlin.internal.InlineOnly
public inline fun String.trim(): String = (this as CharSequence).trim().toString()

Expected behaviour

I expect the line to be fully covered when using Kotlin .trim()

Actual behaviour

screen shot 2018-09-07 at 2 34 52 pm

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions