Reputation: 1357
I have downloaded Kotlin Koans from Github, installed IntelliJ IDEA 2016.1.3 and opened the Koans project. As I understand I need a Configuration
to run the examples. This Configuration
needs a Main class
. I cannot figure out where I find the main class in the Kotlin Koans. I have searched for one but found none (except for a special one in htmlDemo.kt
).
I see that some kind of unit test framework is used. It probably somehow calls task0
but the IDE shows no references to task0
except one from todoTask0
. The only reference to todoTask0
is in task0
. So we have circular references but nowhere do I find an external reference to call up one of these functions.
Can someone explain to me how to get the Kotlin Koans running in the IntelliJ IDE?
Upvotes: 16
Views: 6027
Reputation: 4164
You can run them by clicking the Check Task button. :)
Upvotes: 0
Reputation: 59
In my case, it is the zsh
's bug, can be solved in following:
setopt no_nomatch
in the end of file ~/.zshrc
;source /.zshrc
Upvotes: 0
Reputation: 873
already quite old question but I also struggled a bit. The way to do it is how they described it in their github repo (maybe they changed that since last time you checked)
https://github.com/Kotlin/kotlin-koans
How to build and run tests
Working with the project using Intellij IDEA or Android Studio:
Import the project as Gradle project. To build the project and run tests use 'test' task on Gradle panel.
What I did:
Upvotes: 4
Reputation: 33691
The easiest way is to install the Kotlin Edu plugin. You may read this JB blog post for additional info.
You could also run all koans tests without the plugin.IDEA allows you to run applications and tests directly from the IDE by clicking the Run icon near the test or application definition:
Upvotes: 6
Reputation: 41658
Follow the documentation:
Open up the project in IntelliJ IDEA or your favorite editor. Note: If IntelliJ IDEA prompts you to update the Kotlin library, just click yes.
Run a test. Make it pass
You can trigger a test run by opening a file (i.e kotlin-koans/test/i_introduction/_0_Hello_World/_00_Start.kt
) and hitting:
You can find more information about running tests in IntelliJ in the documentation.
Upvotes: 3