Skip to content
skotch
...

Testing

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.

Use the REPL to test functions interactively:

Terminal window
skotch repl
skotch> fun add(a: Int, b: Int): Int = a + b
skotch> println(add(2, 3))
5

Write .kts scripts that exercise your functions and check results:

test.kts
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")
}
Terminal window
skotch run test.kts

Compile your code and run it with java:

Terminal window
skotch emit --target jvm tests.kt -o TestsKt.class
java -cp . TestsKt

The skotch test command will discover functions annotated with @Test and run them. This is blocked on annotation support in the compiler.