Mustafa Ozhan

    Mustafa Ozhan

    6 months ago
    Recently I saw a post for Kotlin 1.5.0 and I decided to use
    assertIs
    method in whole instance checks in my tests, and I replaced many of
    assertTrue { it is SomeClass }
    with
    assertIs<SomeClass>(it)
    Now, I am checking my coverage and it decreased, all the
    assertIs
    methods seems partially covered Is it expected? are they really partially covered ?
    Klitos Kyriacou

    Klitos Kyriacou

    6 months ago
    Depending on your code coverage checker, it may be treated like a branch, where you have 2 things to cover: the case where the parameter is the asserted type, and the case where it isn't.
    Mustafa Ozhan

    Mustafa Ozhan

    6 months ago
    Yes and isn’t it something to be covered where the implementation of
    assertIs
    is ? This is a method from kotlin standard library
    Fleshgrinder

    Fleshgrinder

    6 months ago
    This is a result of inlining, JaCoCo doesn't know that this code wasn't written by you.