Testing
Current state
Section titled “Current state”Skotch does not yet have a built-in test runner. The skotch test
subcommand exists in the CLI but prints a “not yet implemented” message.
Workarounds
Section titled “Workarounds”Manual testing with the REPL
Section titled “Manual testing with the REPL”Use the REPL to test functions interactively:
skotch replskotch> fun add(a: Int, b: Int): Int = a + bskotch> println(add(2, 3))5Script-based testing
Section titled “Script-based testing”Write .kts scripts that exercise your functions and check results:
fun add(a: Int, b: Int): Int = a + b
val result = add(2, 3)if (result == 5) { println("PASS: add(2, 3) = 5")} else { println("FAIL: add(2, 3) = $result, expected 5")}skotch run test.ktsCompile and run with Java
Section titled “Compile and run with Java”Compile your code and run it with java:
skotch emit --target jvm tests.kt -o TestsKt.classjava -cp . TestsKtPlanned features
Section titled “Planned features”The skotch test command will discover functions annotated with @Test
and run them. This is blocked on annotation support in the compiler.