https://kotlinlang.org logo
#stdlib
Title
# stdlib
m

Mustafa Ozhan

03/05/2022, 12:25 PM
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 ?
k

Klitos Kyriacou

03/05/2022, 6:30 PM
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.
m

Mustafa Ozhan

03/05/2022, 6:56 PM
Yes and isn’t it something to be covered where the implementation of
assertIs
is ? This is a method from kotlin standard library
f

Fleshgrinder

03/05/2022, 7:49 PM
This is a result of inlining, JaCoCo doesn't know that this code wasn't written by you.