Kotlin Koans

I’ve just started with trying learning Kotlin and I’m going through the Kotlin Koans exercises.
I’ve enabled Kotlin support under Android Studio 2.3.2.

When I change the code into kotlin-koans/src/i_introduction/_0_Hello_World/HelloWorld.kt by implementing the required solution and I run the test, it seems the binary of the code under test hasn’t changed as I get the following:

util.NotImplementedException: TODO: **
** Introduction.

** Kotlin Koans project consists of 42 small tasks for you to solve.**
** Typically you’ll have to replace the function invocation ‘todoTaskN()’, which throws an exception,**
** with the correct code according to the problem.**

** Using ‘documentation =’ below the task description you can open the related part of the online documentation.**
** Press ‘Ctrl+Q’(Windows) or ‘F1’(Mac OS) on ‘doc0()’ to call the “Quick Documentation” action;**
** “See also” section gives you a link.**
** You can see the shortcut for the “Quick Documentation” action used in your IntelliJ IDEA**
** by choosing “Help → Find Action…” (in the top menu), and typing the action name (“Quick Documentation”).**
** The shortcut in use will be written next to the action name.**

** Using ‘references =’ you can navigate to the code mentioned in the task description.**

** Let’s start! Make the function ‘task0’ return “OK”.**


** at util.KotlinUtilKt.TODO(kotlinUtil.kt:4)**
** at i_introduction._0_Hello_World.HelloWorldKt.todoTask0(HelloWorld.kt:6)**
** at i_introduction._0_Hello_World.HelloWorldKt.task0(HelloWorld.kt:30)**
** at i_introduction._0_Hello_World._00_Start.testOk(_00_Start.kt:8)**
** at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)**
** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)**
** at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)**
** at java.lang.reflect.Method.invoke(Method.java:498)**
** at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)**
** at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)**
** at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)**
** at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)**
** at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)**
** at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)**
** at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)**
** at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)**
** at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)**
** at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)**
** at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)**
** at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)**
** at org.junit.runners.ParentRunner.run(ParentRunner.java:363)**
** at org.junit.runner.JUnitCore.run(JUnitCore.java:137)**
** at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)**
** at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)**
** at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)**
** at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)**
** at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)**
** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)**
** at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)**
** at java.lang.reflect.Method.invoke(Method.java:498)**
** at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)**

I need to delete the build artefacts manually to get the binary rebuilt.
I still think I’m doing something wrong, but to be honest I thought it should have been at least as straightforward as running JUnit tests.

Could you please advice?

How exactly are you running the tests?

From Android Studio I click on the green run button shown on the test file, like I would do for JUnit tests.
Here’s a link to the video showing what I’m doing:
https://drive.google.com/open?id=0BzHIWdw8cT_McTNnVnJJdkZVTk0

Thank you very much in advance.

Please make sure that the “Make before run” option is enabled in the run configuration settngs.

Unfortunately I’ve got that already.

Basically it’s not possible to run a single test from the IDE.
The only way I can run the Koans correctly is by selecting the test task from the Gradle Projects view, which causes all tests to be run.
I wonder why in Java that’s possible but not in Kotlin.
Would it be possible to confirm that this is a bug rather than an expected behaviour please?

I’ve added an issue: https://youtrack.jetbrains.com/issue/KT-18948.