Open
Description
📝 Description
Having a single class in sample files being a current limitation for Kotools Samples, we want to support Kotlin sample source files with multiple classes.
import kotlin.test.Test
import kotlin.test.assertEquals
class IntKotlinSample {
@Test
fun plus() { // Extracted in 'build/kotools-samples/extracted/IntKotlinSample/plus.md'.
val x = 1
val y = 2
val result: Int = x + y
assertEquals(3, result)
}
}
class LongKotlinSample {
@Test
fun plus() { // Extracted in 'build/kotools-samples/extracted/LongKotlinSample/plus.md'.
val x = 1L
val y = 2L
val result: Long = x + y
assertEquals(3, result)
}
}
By doing so, we don't need to check if sample source files contain a single class.