trackler 2.0.6.34 → 2.0.6.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/change/canonical-data.json +6 -0
- data/common/exercises/luhn/canonical-data.json +35 -0
- data/common/exercises/rotational-cipher/cannonical-data.json +70 -0
- data/common/exercises/rotational-cipher/description.md +30 -0
- data/common/exercises/rotational-cipher/metadata.yml +4 -0
- data/common/exercises/run-length-encoding/description.md +7 -1
- data/lib/trackler/version.rb +1 -1
- data/tracks/elixir/exercises/run-length-encoding/example.exs +15 -4
- data/tracks/elixir/exercises/run-length-encoding/rle.exs +2 -2
- data/tracks/elixir/exercises/run-length-encoding/rle_test.exs +28 -11
- data/tracks/go/exercises/bob/bob_test.go +4 -1
- data/tracks/go/exercises/bracket-push/bracket_push_test.go +5 -2
- data/tracks/go/exercises/circular-buffer/circular_buffer_test.go +6 -6
- data/tracks/go/exercises/clock/clock_test.go +4 -1
- data/tracks/go/exercises/connect/connect_test.go +4 -1
- data/tracks/go/exercises/crypto-square/crypto_square_test.go +5 -2
- data/tracks/go/exercises/luhn/luhn_test.go +1 -1
- data/tracks/javascript/exercises/leap/leap.js +1 -1
- data/tracks/julia/.travis.yml +0 -2
- data/tracks/julia/config.json +41 -0
- data/tracks/julia/exercises/custom-set/HINTS.md +1 -0
- data/tracks/julia/exercises/custom-set/custom-set.jl +0 -0
- data/tracks/julia/exercises/custom-set/example.jl +51 -0
- data/tracks/julia/exercises/custom-set/runtests.jl +200 -0
- data/tracks/julia/exercises/isogram/example.jl +11 -0
- data/tracks/julia/exercises/isogram/isogram.jl +3 -0
- data/tracks/julia/exercises/isogram/runtests.jl +35 -0
- data/tracks/julia/exercises/luhn/example.jl +16 -0
- data/tracks/julia/exercises/luhn/luhn.jl +0 -0
- data/tracks/julia/exercises/luhn/runtests.jl +31 -0
- data/tracks/julia/exercises/nucleotide-count/example.jl +8 -0
- data/tracks/julia/exercises/nucleotide-count/nucleotide-count.jl +3 -0
- data/tracks/julia/exercises/nucleotide-count/runtests.jl +19 -0
- data/tracks/kotlin/.travis.yml +9 -1
- data/tracks/kotlin/README.md +117 -11
- data/tracks/kotlin/bin/journey-test.sh +279 -0
- data/tracks/kotlin/docs/INSTALLATION.md +193 -97
- data/tracks/kotlin/docs/TESTS.md +72 -137
- data/tracks/kotlin/exercises/hello-world/GETTING_STARTED.md +50 -0
- data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +693 -0
- data/tracks/kotlin/exercises/hello-world/src/example/kotlin/HelloWorld.kt +2 -30
- data/tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt +2 -30
- data/tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt +11 -19
- data/tracks/objective-c/circle.yml +1 -1
- data/tracks/perl6/exercises/atbash-cipher/{cipher.t → atbash-cipher.t} +0 -0
- data/tracks/perl6/exercises/linked-list/linked-list.t +0 -0
- data/tracks/perl6/exercises/phone-number/{phone.t → phone-number.t} +0 -0
- data/tracks/perl6/exercises/rna-transcription/{rna_transcription.t → rna-transcription.t} +0 -0
- data/tracks/perl6/exercises/robot-name/{robot.t → robot-name.t} +0 -0
- data/tracks/perl6/exercises/scrabble-score/{scrabble_score.t → scrabble-score.t} +0 -0
- data/tracks/perl6/exercises/word-count/{word_count.t → word-count.t} +0 -0
- data/tracks/pony/config.json +9 -0
- data/tracks/pony/exercises/pascals-triangle/example.pony +18 -0
- data/tracks/pony/exercises/pascals-triangle/test.pony +31 -0
- data/tracks/r/config.json +20 -0
- data/tracks/r/exercises/grains/example.R +16 -0
- data/tracks/r/exercises/grains/grains.R +7 -0
- data/tracks/r/exercises/grains/test_grains.R +49 -0
- data/tracks/r/exercises/phone-number/example.R +30 -0
- data/tracks/r/exercises/phone-number/phone-number.R +3 -0
- data/tracks/r/exercises/phone-number/test_phone-number.R +44 -0
- data/tracks/r/exercises/secret-handshake/example.R +26 -0
- data/tracks/r/exercises/secret-handshake/secret-handshake.R +3 -0
- data/tracks/r/exercises/secret-handshake/test_secret-handshake.R +52 -0
- data/tracks/r/exercises/sieve/example.R +16 -0
- data/tracks/r/exercises/sieve/sieve.R +3 -0
- data/tracks/r/exercises/sieve/test_sieve.R +37 -0
- data/tracks/rust/config.json +11 -0
- data/tracks/rust/exercises/rotational-cipher/Cargo.lock +4 -0
- data/tracks/rust/exercises/rotational-cipher/Cargo.toml +4 -0
- data/tracks/rust/exercises/rotational-cipher/example.rs +16 -0
- data/tracks/rust/exercises/rotational-cipher/tests/rotational-cipher.rs +61 -0
- data/tracks/swift/circle.yml +6 -0
- metadata +46 -8
@@ -1,154 +1,250 @@
|
|
1
|
-
|
1
|
+
# Installing Kotlin
|
2
2
|
|
3
|
-
|
3
|
+
In addition to the exercism CLI and your favorite text editor, practicing with Exercism exercises in Kotlin requires
|
4
4
|
|
5
|
+
* the **Java Development Kit** (JDK) — Kotlin compiles to Java bytecodes; you need to install the JDK which includes both a Java Runtime *and* development tools (most notably, the Java compiler); and
|
6
|
+
* **Gradle** — a build tool specifically for JVM-based projects and supports Kotlin.
|
5
7
|
|
6
|
-
|
8
|
+
Choose your operating system:
|
7
9
|
|
10
|
+
* [Windows](#windows)
|
11
|
+
* [Mac OS X](#mac-os-x)
|
12
|
+
* [Linux](#linux)
|
8
13
|
|
9
|
-
|
14
|
+
... or ...
|
15
|
+
* if you prefer to not use a package maanger, you can [install manually](#install-manually).
|
10
16
|
|
11
|
-
|
17
|
+
Optionally, you can also use a [Java IDE](#java-ides).
|
12
18
|
|
13
|
-
|
14
|
-
C:\Users\johndoe> java -version
|
15
|
-
```
|
19
|
+
----
|
16
20
|
|
17
|
-
|
21
|
+
# Windows
|
18
22
|
|
19
|
-
|
20
|
-
'java' is not recognized as an internal or external command,
|
21
|
-
operable program or batch file.
|
22
|
-
```
|
23
|
+
Open an administrative command prompt. (If you need assistance opening an administrative prompt, see [open an elevated prompt in Windows 8+](http://www.howtogeek.com/194041/how-to-open-the-command-prompt-as-administrator-in-windows-8.1/) (or [Windows 7](http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/)).
|
23
24
|
|
24
|
-
|
25
|
+
1. If you have not installed Chocolatey, do so now:
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
```batchfile
|
28
|
+
C:\Windows\system32> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
|
29
|
+
```
|
30
|
+
2. Install the JDK:
|
28
31
|
|
29
|
-
|
32
|
+
```batchfile
|
33
|
+
C:\Windows\system32> choco install jdk8
|
34
|
+
...
|
35
|
+
C:\Windows\system32> refreshenv
|
36
|
+
...
|
37
|
+
```
|
38
|
+
3. Install Gradle:
|
30
39
|
|
31
|
-
|
40
|
+
```batchfile
|
41
|
+
C:\Windows\system32>choco install gradle
|
42
|
+
...
|
43
|
+
```
|
32
44
|
|
33
|
-
|
34
|
-
C:\Users\johndoe> java -version
|
35
|
-
```
|
45
|
+
We recommend closing the administrative command prompt and opening a new command prompt -- you do not require administrator priviledges to practice Exercism exercises.
|
36
46
|
|
37
|
-
You
|
47
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
38
48
|
|
39
|
-
|
40
|
-
java version "1.8.0_45"
|
41
|
-
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
|
42
|
-
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
|
43
|
-
```
|
49
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
44
50
|
|
45
|
-
|
51
|
+
----
|
46
52
|
|
47
|
-
|
53
|
+
# Mac OS X
|
48
54
|
|
49
|
-
|
55
|
+
Below are instructions for install using the most common method - using Homebrew. If you'd rather, you can also [install on OS X without Homebrew](#installing-on-mac-os-x-without-homebrew).
|
50
56
|
|
51
|
-
|
57
|
+
## Installing
|
52
58
|
|
53
|
-
|
54
|
-
* The first time you do, IntelliJ walks you through some initial setup. We recommend selecting a UI Theme and then just clicking "Skip All and Set Defaults".
|
59
|
+
1. If you haven't installed [Homebrew](http://brew.sh), yet, do so now:
|
55
60
|
|
56
|
-
|
61
|
+
```sh
|
62
|
+
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
63
|
+
```
|
64
|
+
2. Tap the [Homebrew Cask](https://caskroom.github.io/) — this allows us to install pre-built binaries like the JDK.
|
57
65
|
|
58
|
-
|
66
|
+
```
|
67
|
+
$ brew tap caskroom/cask
|
68
|
+
```
|
69
|
+
3. Install the JDK:
|
59
70
|
|
60
|
-
|
71
|
+
```
|
72
|
+
$ brew cask install java
|
73
|
+
```
|
74
|
+
4. Install Gradle:
|
61
75
|
|
62
|
-
|
76
|
+
```
|
77
|
+
$ brew install gradle
|
78
|
+
```
|
63
79
|
|
64
|
-
|
80
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
65
81
|
|
66
|
-
|
67
|
-
This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
|
82
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
68
83
|
|
69
|
-
|
84
|
+
----
|
70
85
|
|
71
|
-
|
86
|
+
# Linux
|
72
87
|
|
73
|
-
|
74
|
-
$ java -version
|
75
|
-
```
|
88
|
+
Below are instructions for install using the package manager of your distro. If you'd rather, you can also [install on Linux without a package manager](#installing-on-linux-without-a-package-manager).
|
76
89
|
|
77
|
-
|
90
|
+
* [Debian](#debian)
|
91
|
+
* [Fedora](#fedora)
|
78
92
|
|
79
|
-
|
93
|
+
## Debian
|
80
94
|
|
81
|
-
If you
|
82
|
-
the OS presents a dialog:
|
95
|
+
If you are using Debian or its derivatives (like Ubuntu or Linux Mint), use APT:
|
83
96
|
|
84
|
-
|
97
|
+
*(verified on: Linux Mint 18, Ubuntu 14)*
|
85
98
|
|
86
|
-
|
99
|
+
1. Install the JDK:
|
87
100
|
|
88
|
-
|
89
|
-
|
90
|
-
|
101
|
+
```sh
|
102
|
+
$ sudo apt-get update
|
103
|
+
$ sudo apt-get install python-software-properties
|
104
|
+
$ sudo add-apt-repository ppa:webupd8team/java
|
105
|
+
$ sudo apt-get update
|
106
|
+
$ sudo apt-get install oracle-java8-installer
|
107
|
+
$ sudo apt install oracle-java8-set-default
|
108
|
+
```
|
109
|
+
2. Install Gradle:
|
91
110
|
|
92
|
-
|
111
|
+
```sh
|
112
|
+
$ sudo add-apt-repository ppa:cwchien/gradle
|
113
|
+
$ sudo apt-get update
|
114
|
+
$ sudo apt-get install gradle
|
115
|
+
```
|
93
116
|
|
94
|
-
|
117
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
95
118
|
|
96
|
-
|
119
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
97
120
|
|
98
|
-
|
99
|
-
java version "1.6.0_65"
|
100
|
-
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
|
101
|
-
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
|
102
|
-
```
|
121
|
+
----
|
103
122
|
|
104
|
-
|
123
|
+
## Fedora
|
105
124
|
|
106
|
-
|
107
|
-
and download the latest version of the JDK (at the time of writing,
|
108
|
-
[JDK 8u91](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
|
109
|
-
2. Run the installer, using all the defaults.
|
125
|
+
If you are using Fedora or its derivatives, use DNF:
|
110
126
|
|
111
|
-
|
127
|
+
*(verified on: Fedora 24)*
|
112
128
|
|
113
|
-
|
129
|
+
1. Install the JDK:
|
114
130
|
|
115
|
-
```
|
116
|
-
$ java
|
117
|
-
```
|
131
|
+
```sh
|
132
|
+
$ sudo dnf install java-1.8.0-openjdk-devel
|
133
|
+
```
|
134
|
+
2. Install Gradle:
|
118
135
|
|
119
|
-
|
136
|
+
```sh
|
137
|
+
$ sudo dnf install gradle
|
138
|
+
```
|
120
139
|
|
121
|
-
```bash
|
122
|
-
java version "1.8.0_45"
|
123
|
-
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
|
124
|
-
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
|
125
|
-
```
|
126
140
|
|
127
|
-
|
128
|
-
Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to
|
129
|
-
have dual numbering conventions. Java 1.8 == Java 8.0.
|
141
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
130
142
|
|
131
|
-
|
143
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
132
144
|
|
133
|
-
|
145
|
+
----
|
134
146
|
|
135
|
-
|
147
|
+
# Install Manually
|
136
148
|
|
137
|
-
|
138
|
-
|
149
|
+
* [Installing on Windows manually](#installing-on-windows-manually)
|
150
|
+
* [Installing on Mac OS X without Homebrew](#installing-on-mac-os-x-without-homebrew)
|
151
|
+
* [Installing on Linux without a package manager](#installing-on-linux-without-a-package-manager)
|
139
152
|
|
140
|
-
|
141
|
-
* The first time you do, IntelliJ walks you through some initial setup. We recommend
|
142
|
-
selecting a UI Theme and then just clicking "Skip All and Set Defaults".
|
153
|
+
----
|
143
154
|
|
144
|
-
|
145
|
-
"Project Defaults", then "Project Structure".
|
155
|
+
## Installing on Windows manually
|
146
156
|
|
147
|
-
|
148
|
-
Click the "New..." button and select "JDK".
|
157
|
+
*NOTE: these instructions are intended for experienced Windows users. If you don't already know how to set environment variables or feel comfortable managing the directory structure, we highly recommend you use the Chocolatey-based install, [above](#windows).*
|
149
158
|
|
150
|
-
|
151
|
-
|
159
|
+
1. Install the JDK:
|
160
|
+
1. Download "**Java Platform (JDK)**" from [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
161
|
+
- Run the installer, using all the defaults.
|
162
|
+
2. Install Gradle:
|
163
|
+
- Download "**Binary only distribution**" from the [Gradle download page](https://gradle.org/gradle-download/).
|
164
|
+
- Unzip the archive. We recommend a place like `C:\Users\JohnDoe\Tools`.
|
165
|
+
- Add a new system environment variable named `GRADLE_HOME` and set it to the path you just created (e.g. `C:\Users\JohnDoe\Tools\gradle-x.y`).
|
166
|
+
- Update the system `Path` to include the `bin` directory from Gradle's home (e.g. `Path`=`...;%GRADLE_HOME%\bin`).
|
167
|
+
|
168
|
+
|
169
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
170
|
+
|
171
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
172
|
+
|
173
|
+
----
|
174
|
+
|
175
|
+
## Installing on Mac OS X without Homebrew
|
176
|
+
|
177
|
+
*NOTE: these instructions are intended for experienced Mac OS X users. Unless you specifically do not want to use a package manager, we highly recommend using the Homebrew-based installation instructions, [above](#mac-os-x).*
|
178
|
+
|
179
|
+
1. Install the JDK:
|
180
|
+
1. Download "**Java Platform (JDK)**" from [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
181
|
+
2. Run the installer, using all the defaults.
|
182
|
+
2. Install Gradle:
|
183
|
+
1. Download "**Binary only distribution**" from the [Gradle download page](https://gradle.org/gradle-download/).
|
184
|
+
2. Unpack Gradle:
|
185
|
+
|
186
|
+
```sh
|
187
|
+
$ mkdir ~/tools
|
188
|
+
$ cd ~/tools
|
189
|
+
$ unzip ~/Downloads/gradle-*-bin.zip
|
190
|
+
$ cd gradle*
|
191
|
+
```
|
192
|
+
3. Configure Gradle and add it to the path:
|
193
|
+
|
194
|
+
```sh
|
195
|
+
$ cat << DONE >> ~/.bashrc
|
196
|
+
export GRADLE_HOME=`pwd`
|
197
|
+
export PATH=\$PATH:\$GRADLE_HOME/bin
|
198
|
+
DONE
|
199
|
+
```
|
200
|
+
|
201
|
+
|
202
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
203
|
+
|
204
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
205
|
+
|
206
|
+
----
|
207
|
+
|
208
|
+
## Installing on Linux without a package manager
|
209
|
+
|
210
|
+
*NOTE: these instructions are intended for experienced Linux users. Unless you specifically do not want to use a package manager, we highly recommend using the the installation instructions, [above](#linux).*
|
211
|
+
|
212
|
+
1. Install the JDK:
|
213
|
+
1. Download "**Java Platform (JDK)**" from [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
214
|
+
2. Run the installer, using all the defaults.
|
215
|
+
2. Install Gradle:
|
216
|
+
1. Download "**Binary only distribution**" from the [Gradle download page](https://gradle.org/gradle-download/).
|
217
|
+
2. Unpack Gradle:
|
218
|
+
|
219
|
+
```sh
|
220
|
+
$ mkdir ~/tools
|
221
|
+
$ cd ~/tools
|
222
|
+
$ unzip ~/Downloads/gradle-*-bin.zip
|
223
|
+
$ cd gradle*
|
224
|
+
```
|
225
|
+
3. Configure Gradle and add it to the path:
|
226
|
+
|
227
|
+
```sh
|
228
|
+
$ cat << DONE >> ~/.bashrc
|
229
|
+
export GRADLE_HOME=`pwd`
|
230
|
+
export PATH=\$PATH:\$GRADLE_HOME/bin
|
231
|
+
DONE
|
232
|
+
```
|
233
|
+
|
234
|
+
You now are ready to get started with the Kotlin track of Exercism!
|
235
|
+
|
236
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/kotlin/tests)".
|
237
|
+
|
238
|
+
----
|
239
|
+
|
240
|
+
# Java IDEs
|
241
|
+
|
242
|
+
There are many Java IDEs available. The three most popular are:
|
243
|
+
|
244
|
+
* [IntelliJ IDEA](https://www.jetbrains.com/idea/download/) (download the "Community" edition)
|
245
|
+
- from the authors of Kotlin, this IDE provides the best support for the language.
|
246
|
+
- [Eclipse](https://www.eclipse.org/downloads/)
|
247
|
+
- [NetBeans](https://netbeans.org/downloads/) (download the "Java SE" bundle)
|
248
|
+
|
249
|
+
and there are [others](https://en.wikibooks.org/wiki/Java_Programming/Java_IDEs).
|
152
250
|
|
153
|
-
6. Back in the "Default Project Structure" dialog, in the "Project language level:" section,
|
154
|
-
select "8 - Lambdas, type annotations etc.". Click "OK".
|
data/tracks/kotlin/docs/TESTS.md
CHANGED
@@ -1,175 +1,110 @@
|
|
1
|
-
|
1
|
+
# Running the Tests
|
2
2
|
|
3
|
-
|
3
|
+
Choose your operating system:
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
* [Windows](#windows)
|
6
|
+
* [Mac OS X](#mac-os-x)
|
7
|
+
* [Linux](#linux)
|
7
8
|
|
8
|
-
|
9
|
-
Kotlin (Etl) C:\Users\johndoe\exercism\kotlin\etl
|
9
|
+
----
|
10
10
|
|
11
|
-
|
12
|
-
```
|
11
|
+
# Windows
|
13
12
|
|
14
|
-
|
13
|
+
1. Open a Command Prompt.
|
14
|
+
2. Get the first exercise:
|
15
15
|
|
16
|
-
|
16
|
+
```batchfile
|
17
|
+
C:\Users\JohnDoe>exercism fetch kotlin
|
18
|
+
|
19
|
+
Not Submitted: 1 problem
|
20
|
+
Kotlin (Hello World) C:\Users\JohnDoe\exercism\kotlin\hello-world
|
17
21
|
|
18
|
-
|
22
|
+
New: 1 problem
|
23
|
+
Kotlin (Hello World) C:\Users\JohnDoe\exercism\kotlin\hello-world
|
19
24
|
|
20
|
-
|
21
|
-
Gradle project: [C:\Users\johndoe\exercism\kotlin\etl\build.gradle ](...)
|
25
|
+
unchanged: 0, updated: 0, new: 1
|
22
26
|
|
23
|
-
|
24
|
-
|
27
|
+
```
|
28
|
+
3. Change directory into the exercism:
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
```batchfile
|
31
|
+
C:\Users\JohnDoe>cd C:\Users\JohnDoe\exercism\kotlin\hello-world
|
32
|
+
```
|
29
33
|
|
30
|
-
|
31
|
-
```
|
34
|
+
4. Run the tests:
|
32
35
|
|
33
|
-
|
36
|
+
```batchfile
|
37
|
+
C:\Users\JohnDoe>gradle test
|
38
|
+
```
|
39
|
+
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
40
|
+
5. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/xkotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
34
41
|
|
35
|
-
* After the project has loaded and you've dismissed the "Tip of the Day" dialog, you may see a notice (in the top-right-hand corner), saying, "Unindex remote maven repositories found." you can safely dismiss this notice.
|
36
42
|
|
37
|
-
|
43
|
+
Good luck! Have fun!
|
38
44
|
|
39
|
-
|
45
|
+
If you get stuck, at any point, don't forget to reach out for [help](http://exercism.io/languages/kotlin/help).
|
40
46
|
|
41
|
-
|
47
|
+
----
|
42
48
|
|
43
|
-
|
49
|
+
# Mac OS X
|
44
50
|
|
45
|
-
|
51
|
+
1. In the terminal window, get the first exercise:
|
46
52
|
|
47
|
-
|
53
|
+
```
|
54
|
+
$ exercism fetch kotlin
|
48
55
|
|
49
|
-
|
56
|
+
New: 1 problem
|
57
|
+
Kotlin (Etl) /Users/johndoe/exercism/kotlin/hello-world
|
50
58
|
|
51
|
-
|
59
|
+
unchanged: 0, updated: 0, new: 1
|
52
60
|
|
53
|
-
|
54
|
-
|
61
|
+
```
|
62
|
+
2. Change directory into the exercise:
|
55
63
|
|
56
|
-
|
57
|
-
|
64
|
+
```
|
65
|
+
$ cd /Users/johndoe/exercism/kotlin/hello-world
|
66
|
+
```
|
67
|
+
3. Run the tests:
|
58
68
|
|
59
|
-
|
69
|
+
```
|
70
|
+
$ gradle test
|
71
|
+
```
|
72
|
+
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
73
|
+
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/xkotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
60
74
|
|
61
|
-
|
75
|
+
Good luck! Have fun!
|
62
76
|
|
63
|
-
|
77
|
+
If you get stuck, at any point, don't forget to reach out for [help](http://exercism.io/languages/kotlin/help).
|
64
78
|
|
65
|
-
|
79
|
+
----
|
66
80
|
|
67
|
-
|
68
|
-
"etl" folder. Click "OK".
|
81
|
+
# Linux
|
69
82
|
|
70
|
-
|
71
|
-
checkboxes and select "Use customizable gradle wrapper".
|
83
|
+
1. In the terminal window, get the first exercise:
|
72
84
|
|
73
|
-
|
85
|
+
```
|
86
|
+
$ exercism fetch kotlin
|
74
87
|
|
75
|
-
|
88
|
+
New: 1 problem
|
89
|
+
Kotlin (Etl) /home/johndoe/exercism/kotlin/hello-world
|
76
90
|
|
77
|
-
|
78
|
-
notice (in the top-right-hand corner), saying, "Unindex remote maven repositories found." you can
|
79
|
-
safely dismiss this notice.
|
91
|
+
unchanged: 0, updated: 0, new: 1
|
80
92
|
|
81
|
-
|
93
|
+
```
|
94
|
+
2. Change directory into the exercise:
|
82
95
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
96
|
+
```
|
97
|
+
$ cd /home/johndoe/exercism/kotlin/hello-world
|
98
|
+
```
|
99
|
+
3. Run the tests:
|
87
100
|
|
88
|
-
|
89
|
-
|
101
|
+
```
|
102
|
+
$ gradle test
|
103
|
+
```
|
104
|
+
*(Don't worry about the tests failing, at first, this is how you begin each exercise.)*
|
105
|
+
4. Solve the exercise. Find and work through the `GETTING_STARTED.md` guide ([view on GitHub](https://github.com/exercism/xkotlin/blob/master/exercises/hello-world/GETTING_STARTED.md)).
|
90
106
|
|
91
|
-
|
92
|
-
setting expectations on a class that you need to write. By trying to run the tests, you get a
|
93
|
-
nice list of what needs to be fixed in the "Messages Make" view.
|
107
|
+
Good luck! Have fun!
|
94
108
|
|
95
|
-
|
109
|
+
If you get stuck, at any point, don't forget to reach out for [help](http://exercism.io/languages/kotlin/help).
|
96
110
|
|
97
|
-
#### Option 2: Command Line
|
98
|
-
|
99
|
-
The Exercism exercises for Kotlin can be built and tested from the command line using [Gradle](https://gradle.org).
|
100
|
-
|
101
|
-
After [installing Gradle](https://www.jayway.com/2013/05/12/getting-started-with-gradle), you can run the tests for any exercise by running `gradle test`, as long as you're in the same directory as the `build.gradle` file:
|
102
|
-
|
103
|
-
```
|
104
|
-
$ pwd
|
105
|
-
/Users/johndoe/Code/exercism/kotlin/hello-world
|
106
|
-
|
107
|
-
$ gradle test
|
108
|
-
...
|
109
|
-
|
110
|
-
:test
|
111
|
-
|
112
|
-
HelloWorldTest > helloSampleName FAILED
|
113
|
-
org.junit.ComparisonFailure at HelloWorldTest.kt:25
|
114
|
-
|
115
|
-
HelloWorldTest > helloNullName FAILED
|
116
|
-
org.junit.ComparisonFailure at HelloWorldTest.kt:20
|
117
|
-
|
118
|
-
HelloWorldTest > helloBlankName FAILED
|
119
|
-
org.junit.ComparisonFailure at HelloWorldTest.kt:13
|
120
|
-
|
121
|
-
HelloWorldTest > helloNoName FAILED
|
122
|
-
org.junit.ComparisonFailure at HelloWorldTest.kt:8
|
123
|
-
|
124
|
-
HelloWorldTest > helloAnotherSampleName FAILED
|
125
|
-
org.junit.ComparisonFailure at HelloWorldTest.kt:30
|
126
|
-
|
127
|
-
5 tests completed, 5 failed
|
128
|
-
:test FAILED
|
129
|
-
|
130
|
-
FAILURE: Build failed with an exception.
|
131
|
-
|
132
|
-
* What went wrong:
|
133
|
-
Execution failed for task ':test'.
|
134
|
-
> There were failing tests. See the report at: file:///Users/johndoe/Code/exercism/kotlin/hello-world/build/reports/tests/test/index.html
|
135
|
-
|
136
|
-
* Try:
|
137
|
-
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
|
138
|
-
|
139
|
-
BUILD FAILED
|
140
|
-
|
141
|
-
Total time: 1.141 secs
|
142
|
-
```
|
143
|
-
|
144
|
-
When test cases are failing, you can get more information about the failing tests by including the `test` task's `--info` option:
|
145
|
-
|
146
|
-
```
|
147
|
-
$ gradle test --info
|
148
|
-
...
|
149
|
-
|
150
|
-
:test
|
151
|
-
|
152
|
-
...
|
153
|
-
|
154
|
-
HelloWorldTest > helloSampleName FAILED
|
155
|
-
org.junit.ComparisonFailure: expected:<Hell[o], Alice!> but was:<Hell[ooo], Alice!>
|
156
|
-
at org.junit.Assert.assertEquals(Assert.java:115)
|
157
|
-
at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:23)
|
158
|
-
at kotlin.test.AssertionsKt__TestAssertionsKt.assertEquals(TestAssertions.kt:29)
|
159
|
-
at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
|
160
|
-
at kotlin.test.AssertionsKt__TestAssertionsKt.assertEquals$default(TestAssertions.kt:28)
|
161
|
-
at kotlin.test.AssertionsKt.assertEquals$default(Unknown Source)
|
162
|
-
at HelloWorldTest.helloSampleName(HelloWorldTest.kt:25)
|
163
|
-
|
164
|
-
...
|
165
|
-
|
166
|
-
5 tests completed, 5 failed
|
167
|
-
|
168
|
-
...
|
169
|
-
|
170
|
-
BUILD FAILED
|
171
|
-
|
172
|
-
Total time: 1.162 secs
|
173
|
-
|
174
|
-
...
|
175
|
-
```
|