https://kotlinlang.org logo
p

pajatopmr

03/30/2021, 9:17 PM
It seems to me that there are three Kotlin language constructs that are of interest to a Koltin code coverage tool: 1. property initialization (top level, class and inside a function, including arguments). 2. statement and expression execution inside functions (top level, methods of a class and local functions). 3. class constructor argument initialization. (Could these be considered properties?) Surely it cannot be that simple, or can it? Granted, the second item breaks down into a number of items of interest, especially 
if
 and 
when
.
r

rnett

03/31/2021, 1:52 AM
Remember something like
class Test(val a = run{ whateverIWant() })
is fine, so you have to handle arbitrary code. Plus lambdas may not be ran right away, i.e.
lazy
.
p

pajatopmr

03/31/2021, 5:03 AM
Good points. I'll plan on having test cases for both.
4 Views