trackler 2.0.6.33 → 2.0.6.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/delphi/exercises/beer-song/inputdata.txt +7 -0
- data/tracks/delphi/exercises/beer-song/uBeerSongExample.pas +12 -12
- data/tracks/delphi/exercises/beer-song/uBeerSongTests.pas +74 -59
- data/tracks/elixir/exercises/grains/example.exs +3 -2
- data/tracks/elixir/exercises/grains/grains_test.exs +24 -8
- data/tracks/go/exercises/binary-search/binary_search_test.go +8 -0
- data/tracks/go/exercises/binary-search/example.go +2 -0
- data/tracks/go/exercises/binary/binary_test.go +5 -2
- data/tracks/go/exercises/variable-length-quantity/example.go +2 -0
- data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +8 -0
- data/tracks/go/exercises/word-count/word_count_test.go +4 -1
- data/tracks/julia/config.json +26 -0
- data/tracks/julia/exercises/gigasecond/example.jl +1 -0
- data/tracks/julia/exercises/gigasecond/gigasecond.jl +3 -0
- data/tracks/julia/exercises/gigasecond/runtests.jl +15 -0
- data/tracks/julia/exercises/roman-numerals/example.jl +21 -0
- data/tracks/julia/exercises/roman-numerals/roman-numerals.jl +3 -0
- data/tracks/julia/exercises/roman-numerals/runtests.jl +37 -0
- data/tracks/julia/exercises/transpose/example.jl +20 -0
- data/tracks/julia/exercises/transpose/runtests.jl +212 -0
- data/tracks/julia/exercises/transpose/transpose.jl +3 -0
- data/tracks/kotlin/.travis.yml +5 -2
- data/tracks/kotlin/bin/{build.sh → unit-tests.sh} +8 -6
- data/tracks/kotlin/exercises/_template/build.gradle +6 -0
- data/tracks/kotlin/exercises/accumulate/build.gradle +6 -0
- data/tracks/kotlin/exercises/accumulate/src/test/kotlin/AccumulateTest.kt +7 -0
- data/tracks/kotlin/exercises/acronym/build.gradle +6 -0
- data/tracks/kotlin/exercises/acronym/src/test/kotlin/AcronymTest.kt +7 -0
- data/tracks/kotlin/exercises/allergies/build.gradle +6 -0
- data/tracks/kotlin/exercises/allergies/src/test/kotlin/AllergiesTest.kt +20 -0
- data/tracks/kotlin/exercises/anagram/build.gradle +6 -0
- data/tracks/kotlin/exercises/anagram/src/test/kotlin/AnagramTest.kt +11 -0
- data/tracks/kotlin/exercises/atbash-cipher/build.gradle +6 -0
- data/tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt +3 -0
- data/tracks/kotlin/exercises/beer-song/build.gradle +6 -0
- data/tracks/kotlin/exercises/beer-song/src/test/kotlin/BeerSongTest.kt +13 -0
- data/tracks/kotlin/exercises/binary-search/build.gradle +6 -0
- data/tracks/kotlin/exercises/binary-search/src/test/kotlin/BinarySearchTest.kt +9 -0
- data/tracks/kotlin/exercises/binary/build.gradle +6 -0
- data/tracks/kotlin/exercises/binary/src/test/kotlin/BinaryTest.kt +2 -0
- data/tracks/kotlin/exercises/bob/build.gradle +6 -0
- data/tracks/kotlin/exercises/bob/src/test/kotlin/BobTest.kt +19 -0
- data/tracks/kotlin/exercises/bracket-push/build.gradle +6 -0
- data/tracks/kotlin/exercises/bracket-push/src/test/kotlin/BracketPushTest.kt +2 -0
- data/tracks/kotlin/exercises/build.gradle +17 -1
- data/tracks/kotlin/exercises/change/build.gradle +6 -0
- data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeTest.kt +9 -0
- data/tracks/kotlin/exercises/difference-of-squares/build.gradle +6 -0
- data/tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt +13 -1
- data/tracks/kotlin/exercises/etl/build.gradle +6 -0
- data/tracks/kotlin/exercises/etl/src/test/kotlin/ETLTest.kt +5 -0
- data/tracks/kotlin/exercises/flatten-array/build.gradle +6 -0
- data/tracks/kotlin/exercises/flatten-array/src/test/kotlin/FlattenerTest.kt +9 -1
- data/tracks/kotlin/exercises/gigasecond/build.gradle +6 -0
- data/tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt +6 -0
- data/tracks/kotlin/exercises/grade-school/build.gradle +6 -0
- data/tracks/kotlin/exercises/grade-school/src/test/kotlin/SchoolTest.kt +8 -0
- data/tracks/kotlin/exercises/hamming/build.gradle +6 -0
- data/tracks/kotlin/exercises/hamming/src/test/kotlin/HammingTest.kt +10 -0
- data/tracks/kotlin/exercises/hello-world/build.gradle +6 -0
- data/tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt +6 -0
- data/tracks/kotlin/exercises/hexadecimal/build.gradle +6 -0
- data/tracks/kotlin/exercises/hexadecimal/src/test/kotlin/HexadecimalTest.kt +2 -0
- data/tracks/kotlin/exercises/isogram/build.gradle +6 -0
- data/tracks/kotlin/exercises/isogram/src/test/kotlin/IsogramTest.kt +2 -0
- data/tracks/kotlin/exercises/largest-series-product/build.gradle +6 -0
- data/tracks/kotlin/exercises/largest-series-product/src/test/kotlin/SeriesInvalidInputTest.kt +5 -0
- data/tracks/kotlin/exercises/largest-series-product/src/test/kotlin/SeriesValidInputTest.kt +2 -0
- data/tracks/kotlin/exercises/leap/build.gradle +6 -0
- data/tracks/kotlin/exercises/leap/src/test/kotlin/LeapTest.kt +8 -0
- data/tracks/kotlin/exercises/linked-list/build.gradle +6 -0
- data/tracks/kotlin/exercises/linked-list/src/test/kotlin/DequeTest.kt +6 -0
- data/tracks/kotlin/exercises/luhn/build.gradle +6 -0
- data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +11 -0
- data/tracks/kotlin/exercises/nth-prime/build.gradle +6 -0
- data/tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt +6 -0
- data/tracks/kotlin/exercises/nucleotide-count/build.gradle +6 -0
- data/tracks/kotlin/exercises/nucleotide-count/src/test/kotlin/NucleotideTest.kt +12 -1
- data/tracks/kotlin/exercises/pangram/build.gradle +6 -0
- data/tracks/kotlin/exercises/pangram/src/test/kotlin/PangramTest.kt +11 -0
- data/tracks/kotlin/exercises/pascals-triangle/build.gradle +6 -0
- data/tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt +5 -0
- data/tracks/kotlin/exercises/phone-number/build.gradle +6 -0
- data/tracks/kotlin/exercises/phone-number/src/test/kotlin/PhoneNumberTest.kt +9 -0
- data/tracks/kotlin/exercises/pig-latin/build.gradle +6 -0
- data/tracks/kotlin/exercises/pig-latin/src/test/kotlin/PigLatinTest.kt +2 -0
- data/tracks/kotlin/exercises/raindrops/build.gradle +6 -0
- data/tracks/kotlin/exercises/raindrops/src/test/kotlin/RaindropsTest.kt +2 -0
- data/tracks/kotlin/exercises/rna-transcription/build.gradle +6 -0
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +8 -1
- data/tracks/kotlin/exercises/robot-name/build.gradle +6 -0
- data/tracks/kotlin/exercises/robot-name/src/test/kotlin/RobotTest.kt +4 -0
- data/tracks/kotlin/exercises/roman-numerals/build.gradle +6 -0
- data/tracks/kotlin/exercises/roman-numerals/src/test/kotlin/RomanNumeralTest.kt +2 -0
- data/tracks/kotlin/exercises/scrabble-score/build.gradle +6 -0
- data/tracks/kotlin/exercises/scrabble-score/src/test/kotlin/ScrabbleScoreTest.kt +2 -0
- data/tracks/kotlin/exercises/series/build.gradle +6 -0
- data/tracks/kotlin/exercises/series/src/test/kotlin/SeriesTest.kt +4 -0
- data/tracks/kotlin/exercises/sieve/build.gradle +6 -0
- data/tracks/kotlin/exercises/sieve/src/test/kotlin/SieveTest.kt +4 -0
- data/tracks/kotlin/exercises/simple-cipher/build.gradle +6 -0
- data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/IncorrectKeyCipherTest.kt +6 -0
- data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/RandomKeyCipherTest.kt +7 -0
- data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/SubstitutionCipherTest.kt +9 -0
- data/tracks/kotlin/exercises/space-age/build.gradle +6 -0
- data/tracks/kotlin/exercises/space-age/src/test/kotlin/SpaceAgeTest.kt +10 -0
- data/tracks/kotlin/exercises/strain/build.gradle +6 -0
- data/tracks/kotlin/exercises/strain/src/test/kotlin/StrainTest.kt +13 -0
- data/tracks/kotlin/exercises/word-count/build.gradle +6 -0
- data/tracks/kotlin/exercises/word-count/src/test/kotlin/WordCountTest.kt +8 -0
- data/tracks/objective-c/circle.yml +1 -1
- data/tracks/perl6/.travis.yml +2 -2
- data/tracks/perl6/config.json +5 -0
- data/tracks/perl6/docs/TESTS.md +78 -18
- data/tracks/perl6/exercises/allergies/{Example.p6 → Example.pm} +0 -0
- data/tracks/perl6/exercises/allergies/allergies.t +2 -7
- data/tracks/perl6/exercises/atbash-cipher/{Example.p6 → Example.pm} +0 -0
- data/tracks/perl6/exercises/atbash-cipher/cipher.t +2 -7
- data/tracks/perl6/exercises/linked-list/Example.pm6 +51 -0
- data/tracks/perl6/exercises/linked-list/linked-list.t +91 -0
- data/tracks/perl6/exercises/space-age/{Example.p6 → Example.pm} +0 -0
- data/tracks/perl6/exercises/space-age/space-age.t +2 -7
- data/tracks/perl6/exercises/trinary/{Example.p6 → Example.pm} +0 -0
- data/tracks/perl6/exercises/trinary/trinary.t +2 -7
- data/tracks/perl6/exercises/wordy/{Example.p6 → Example.pm} +0 -0
- data/tracks/perl6/exercises/wordy/wordy.t +2 -7
- data/tracks/pony/README.md +4 -27
- data/tracks/pony/config.json +16 -0
- data/tracks/pony/exercises/atbash-cipher/example.pony +40 -0
- data/tracks/pony/exercises/atbash-cipher/test.pony +67 -0
- data/tracks/pony/exercises/beer-song/example.pony +44 -0
- data/tracks/pony/exercises/beer-song/test.pony +27 -0
- data/tracks/pony/exercises/rna-transcription/test.pony +1 -1
- data/tracks/prolog/docs/INSTALLATION.md +1 -1
- data/tracks/prolog/docs/TESTS.md +2 -2
- metadata +24 -8
@@ -1,8 +1,10 @@
|
|
1
1
|
import org.junit.Test
|
2
|
+
import org.junit.Ignore
|
2
3
|
import kotlin.test.assertEquals
|
3
4
|
|
4
5
|
class AcronymTest {
|
5
6
|
|
7
|
+
|
6
8
|
@Test
|
7
9
|
fun fromTitleCasedPhrases() {
|
8
10
|
val phrase = "Portable Network Graphics"
|
@@ -10,6 +12,7 @@ class AcronymTest {
|
|
10
12
|
assertEquals(expected, Acronym.generate(phrase))
|
11
13
|
}
|
12
14
|
|
15
|
+
@Ignore
|
13
16
|
@Test
|
14
17
|
fun fromOtherTitleCasedPhrases() {
|
15
18
|
val phrase = "Ruby on Rails"
|
@@ -17,6 +20,7 @@ class AcronymTest {
|
|
17
20
|
assertEquals(expected, Acronym.generate(phrase))
|
18
21
|
}
|
19
22
|
|
23
|
+
@Ignore
|
20
24
|
@Test
|
21
25
|
fun fromInconsistentlyCasedPhrases() {
|
22
26
|
val phrase = "HyperText Markup Language"
|
@@ -24,6 +28,7 @@ class AcronymTest {
|
|
24
28
|
assertEquals(expected, Acronym.generate(phrase))
|
25
29
|
}
|
26
30
|
|
31
|
+
@Ignore
|
27
32
|
@Test
|
28
33
|
fun fromPhrasesWithPunctuation() {
|
29
34
|
val phrase = "First In, First Out"
|
@@ -31,6 +36,7 @@ class AcronymTest {
|
|
31
36
|
assertEquals(expected, Acronym.generate(phrase))
|
32
37
|
}
|
33
38
|
|
39
|
+
@Ignore
|
34
40
|
@Test
|
35
41
|
fun fromOtherPhrasesWithPunctuation() {
|
36
42
|
val phrase = "PHP: Hypertext Preprocessor"
|
@@ -38,6 +44,7 @@ class AcronymTest {
|
|
38
44
|
assertEquals(expected, Acronym.generate(phrase))
|
39
45
|
}
|
40
46
|
|
47
|
+
@Ignore
|
41
48
|
@Test
|
42
49
|
fun fromPhrasesWithPunctuationAndSentenceCasing() {
|
43
50
|
val phrase = "Complementary metal-oxide semiconductor"
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import org.junit.Test
|
2
|
+
import org.junit.Ignore
|
2
3
|
import kotlin.test.assertEquals
|
3
4
|
|
4
5
|
class AllergiesTest {
|
5
6
|
|
7
|
+
|
6
8
|
@Test
|
7
9
|
fun noAllergiesMeansNotAllergicToAnything() {
|
8
10
|
val allergies = Allergies(0)
|
@@ -13,6 +15,7 @@ class AllergiesTest {
|
|
13
15
|
assertEquals(false, allergies.isAllergicTo(Allergen.CATS))
|
14
16
|
}
|
15
17
|
|
18
|
+
@Ignore
|
16
19
|
@Test
|
17
20
|
fun allergicToEggs() {
|
18
21
|
val allergies = Allergies(1)
|
@@ -20,6 +23,7 @@ class AllergiesTest {
|
|
20
23
|
assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
|
21
24
|
}
|
22
25
|
|
26
|
+
@Ignore
|
23
27
|
@Test
|
24
28
|
fun allergicToPeanuts() {
|
25
29
|
val allergies = Allergies(2)
|
@@ -27,6 +31,7 @@ class AllergiesTest {
|
|
27
31
|
assertEquals(true, allergies.isAllergicTo(Allergen.PEANUTS))
|
28
32
|
}
|
29
33
|
|
34
|
+
@Ignore
|
30
35
|
@Test
|
31
36
|
fun allergicToShellfish() {
|
32
37
|
val allergies = Allergies(4)
|
@@ -34,6 +39,7 @@ class AllergiesTest {
|
|
34
39
|
assertEquals(true, allergies.isAllergicTo(Allergen.SHELLFISH))
|
35
40
|
}
|
36
41
|
|
42
|
+
@Ignore
|
37
43
|
@Test
|
38
44
|
fun allergicToStrawberries() {
|
39
45
|
val allergies = Allergies(8)
|
@@ -41,6 +47,7 @@ class AllergiesTest {
|
|
41
47
|
assertEquals(true, allergies.isAllergicTo(Allergen.STRAWBERRIES))
|
42
48
|
}
|
43
49
|
|
50
|
+
@Ignore
|
44
51
|
@Test
|
45
52
|
fun allergicToTomatoes() {
|
46
53
|
val allergies = Allergies(16)
|
@@ -48,6 +55,7 @@ class AllergiesTest {
|
|
48
55
|
assertEquals(true, allergies.isAllergicTo(Allergen.TOMATOES))
|
49
56
|
}
|
50
57
|
|
58
|
+
@Ignore
|
51
59
|
@Test
|
52
60
|
fun allergicToChocolate() {
|
53
61
|
val allergies = Allergies(32)
|
@@ -55,6 +63,7 @@ class AllergiesTest {
|
|
55
63
|
assertEquals(true, allergies.isAllergicTo(Allergen.CHOCOLATE))
|
56
64
|
}
|
57
65
|
|
66
|
+
@Ignore
|
58
67
|
@Test
|
59
68
|
fun allergicToPollen() {
|
60
69
|
val allergies = Allergies(64)
|
@@ -62,6 +71,7 @@ class AllergiesTest {
|
|
62
71
|
assertEquals(true, allergies.isAllergicTo(Allergen.POLLEN))
|
63
72
|
}
|
64
73
|
|
74
|
+
@Ignore
|
65
75
|
@Test
|
66
76
|
fun allergicToCats() {
|
67
77
|
val allergies = Allergies(128)
|
@@ -69,6 +79,7 @@ class AllergiesTest {
|
|
69
79
|
assertEquals(true, allergies.isAllergicTo(Allergen.CATS))
|
70
80
|
}
|
71
81
|
|
82
|
+
@Ignore
|
72
83
|
@Test
|
73
84
|
fun isAllergicToEggsInAdditionToOtherStuff() {
|
74
85
|
val allergies = Allergies(5)
|
@@ -76,6 +87,7 @@ class AllergiesTest {
|
|
76
87
|
assertEquals(true, allergies.isAllergicTo(Allergen.EGGS))
|
77
88
|
}
|
78
89
|
|
90
|
+
@Ignore
|
79
91
|
@Test
|
80
92
|
fun noAllergies() {
|
81
93
|
val allergies = Allergies(0)
|
@@ -83,6 +95,7 @@ class AllergiesTest {
|
|
83
95
|
assertEquals(0, allergies.getList().size)
|
84
96
|
}
|
85
97
|
|
98
|
+
@Ignore
|
86
99
|
@Test
|
87
100
|
fun isAllergicToJustEggs() {
|
88
101
|
val allergies = Allergies(1)
|
@@ -91,6 +104,7 @@ class AllergiesTest {
|
|
91
104
|
assertEquals(expectedAllergens, allergies.getList())
|
92
105
|
}
|
93
106
|
|
107
|
+
@Ignore
|
94
108
|
@Test
|
95
109
|
fun isAllergicToJustPeanuts() {
|
96
110
|
val allergies = Allergies(2)
|
@@ -99,6 +113,7 @@ class AllergiesTest {
|
|
99
113
|
assertEquals(expectedAllergens, allergies.getList())
|
100
114
|
}
|
101
115
|
|
116
|
+
@Ignore
|
102
117
|
@Test
|
103
118
|
fun isAllergicToJustStrawberries() {
|
104
119
|
val allergies = Allergies(8)
|
@@ -107,6 +122,7 @@ class AllergiesTest {
|
|
107
122
|
assertEquals(expectedAllergens, allergies.getList())
|
108
123
|
}
|
109
124
|
|
125
|
+
@Ignore
|
110
126
|
@Test
|
111
127
|
fun isAllergicToEggsAndPeanuts() {
|
112
128
|
val allergies = Allergies(3)
|
@@ -118,6 +134,7 @@ class AllergiesTest {
|
|
118
134
|
assertEquals(expectedAllergens, allergies.getList())
|
119
135
|
}
|
120
136
|
|
137
|
+
@Ignore
|
121
138
|
@Test
|
122
139
|
fun isAllergicToEggsAndShellfish() {
|
123
140
|
val allergies = Allergies(5)
|
@@ -129,6 +146,7 @@ class AllergiesTest {
|
|
129
146
|
assertEquals(expectedAllergens, allergies.getList())
|
130
147
|
}
|
131
148
|
|
149
|
+
@Ignore
|
132
150
|
@Test
|
133
151
|
fun isAllergicToLotsOfStuff() {
|
134
152
|
val allergies = Allergies(248)
|
@@ -143,6 +161,7 @@ class AllergiesTest {
|
|
143
161
|
assertEquals(expectedAllergens, allergies.getList())
|
144
162
|
}
|
145
163
|
|
164
|
+
@Ignore
|
146
165
|
@Test
|
147
166
|
fun isAllergicToEverything() {
|
148
167
|
val allergies = Allergies(255)
|
@@ -160,6 +179,7 @@ class AllergiesTest {
|
|
160
179
|
assertEquals(expectedAllergens, allergies.getList())
|
161
180
|
}
|
162
181
|
|
182
|
+
@Ignore
|
163
183
|
@Test
|
164
184
|
fun ignoreNonAllergenScoreParts() {
|
165
185
|
val allergies = Allergies(509)
|
@@ -1,14 +1,17 @@
|
|
1
1
|
import org.junit.Test
|
2
|
+
import org.junit.Ignore
|
2
3
|
import kotlin.test.assertEquals
|
3
4
|
|
4
5
|
class AnagramTest {
|
5
6
|
|
7
|
+
|
6
8
|
@Test
|
7
9
|
fun noMatches() {
|
8
10
|
val detector = Anagram("diaper")
|
9
11
|
assertEquals(listOf(), detector.match(listOf("hello", "world", "zombies", "pants")))
|
10
12
|
}
|
11
13
|
|
14
|
+
@Ignore
|
12
15
|
@Test
|
13
16
|
fun simpleAnagram() {
|
14
17
|
val detector = Anagram("ant")
|
@@ -16,6 +19,7 @@ class AnagramTest {
|
|
16
19
|
assertEquals(listOf("tan"), anagram)
|
17
20
|
}
|
18
21
|
|
22
|
+
@Ignore
|
19
23
|
@Test
|
20
24
|
fun detectMultipleAnagrams() {
|
21
25
|
val detector = Anagram("master")
|
@@ -23,6 +27,7 @@ class AnagramTest {
|
|
23
27
|
assertEquals(listOf("maters", "stream"), anagrams.sorted())
|
24
28
|
}
|
25
29
|
|
30
|
+
@Ignore
|
26
31
|
@Test
|
27
32
|
fun doesNotConfuseDifferentDuplicates() {
|
28
33
|
val detector = Anagram("galea")
|
@@ -30,6 +35,7 @@ class AnagramTest {
|
|
30
35
|
assertEquals(listOf(), anagrams)
|
31
36
|
}
|
32
37
|
|
38
|
+
@Ignore
|
33
39
|
@Test
|
34
40
|
fun identicalWordIsNotAnagram() {
|
35
41
|
val detector = Anagram("corn")
|
@@ -37,18 +43,21 @@ class AnagramTest {
|
|
37
43
|
assertEquals(listOf("cron"), anagrams)
|
38
44
|
}
|
39
45
|
|
46
|
+
@Ignore
|
40
47
|
@Test
|
41
48
|
fun eliminateAnagramsWithSameChecksum() {
|
42
49
|
val detector = Anagram("mass")
|
43
50
|
assertEquals(listOf(), detector.match(listOf("last")))
|
44
51
|
}
|
45
52
|
|
53
|
+
@Ignore
|
46
54
|
@Test
|
47
55
|
fun eliminateAnagramSubsets() {
|
48
56
|
val detector = Anagram("good")
|
49
57
|
assertEquals(listOf(), detector.match(listOf("dog", "goody")))
|
50
58
|
}
|
51
59
|
|
60
|
+
@Ignore
|
52
61
|
@Test
|
53
62
|
fun detectAnagrams() {
|
54
63
|
val detector = Anagram("listen")
|
@@ -56,6 +65,7 @@ class AnagramTest {
|
|
56
65
|
assertEquals(listOf("inlets"), anagrams)
|
57
66
|
}
|
58
67
|
|
68
|
+
@Ignore
|
59
69
|
@Test
|
60
70
|
fun multipleAnagrams() {
|
61
71
|
val detector = Anagram("allergy")
|
@@ -63,6 +73,7 @@ class AnagramTest {
|
|
63
73
|
assertEquals(listOf("gallery", "largely", "regally"), anagrams.sorted())
|
64
74
|
}
|
65
75
|
|
76
|
+
@Ignore
|
66
77
|
@Test
|
67
78
|
fun anagramsAreCaseInsensitive() {
|
68
79
|
val detector = Anagram("Orchestra")
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import org.junit.Test
|
2
|
+
import org.junit.Ignore
|
2
3
|
import org.junit.experimental.runners.Enclosed
|
3
4
|
import org.junit.runner.RunWith
|
4
5
|
import org.junit.runners.Parameterized
|
@@ -24,6 +25,7 @@ class AtbashTest {
|
|
24
25
|
)
|
25
26
|
}
|
26
27
|
|
28
|
+
|
27
29
|
@Test
|
28
30
|
fun test() {
|
29
31
|
assertEquals(expectedOutput, Atbash.encode(input))
|
@@ -43,6 +45,7 @@ class AtbashTest {
|
|
43
45
|
)
|
44
46
|
}
|
45
47
|
|
48
|
+
@Ignore
|
46
49
|
@Test
|
47
50
|
fun test() {
|
48
51
|
assertEquals(expectedOutput, Atbash.decode(input))
|
@@ -1,71 +1,84 @@
|
|
1
1
|
import org.junit.Test
|
2
|
+
import org.junit.Ignore
|
2
3
|
import kotlin.test.assertEquals
|
3
4
|
import kotlin.test.assertFailsWith
|
4
5
|
|
5
6
|
class BeerSongTest {
|
6
7
|
|
8
|
+
|
7
9
|
@Test
|
8
10
|
fun verse0() {
|
9
11
|
val expected = "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n"
|
10
12
|
assertEquals(expected, BeerSong.verse(0))
|
11
13
|
}
|
12
14
|
|
15
|
+
@Ignore
|
13
16
|
@Test
|
14
17
|
fun verse1() {
|
15
18
|
val expected = "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n"
|
16
19
|
assertEquals(expected, BeerSong.verse(1))
|
17
20
|
}
|
18
21
|
|
22
|
+
@Ignore
|
19
23
|
@Test
|
20
24
|
fun verse2() {
|
21
25
|
val expected = "2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n"
|
22
26
|
assertEquals(expected, BeerSong.verse(2))
|
23
27
|
}
|
24
28
|
|
29
|
+
@Ignore
|
25
30
|
@Test
|
26
31
|
fun verse8() {
|
27
32
|
val expected = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n"
|
28
33
|
assertEquals(expected, BeerSong.verse(8))
|
29
34
|
}
|
30
35
|
|
36
|
+
@Ignore
|
31
37
|
@Test
|
32
38
|
fun verse99() {
|
33
39
|
val expected = "99 bottles of beer on the wall, 99 bottles of beer.\nTake one down and pass it around, 98 bottles of beer on the wall.\n"
|
34
40
|
assertEquals(expected, BeerSong.verse(99))
|
35
41
|
}
|
36
42
|
|
43
|
+
@Ignore
|
37
44
|
@Test
|
38
45
|
fun verseMinus1() {
|
39
46
|
assertFailsWith(IllegalArgumentException::class, "Beer song verse can't be negative", { BeerSong.verse(-1) })
|
40
47
|
}
|
41
48
|
|
49
|
+
@Ignore
|
42
50
|
@Test
|
43
51
|
fun verse100() {
|
44
52
|
assertFailsWith(IllegalArgumentException::class, "Beer song only goes up to verse 99", { BeerSong.verse(100) })
|
45
53
|
}
|
46
54
|
|
55
|
+
@Ignore
|
47
56
|
@Test
|
48
57
|
fun songVerse8To6() {
|
49
58
|
val expected = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n"
|
50
59
|
assertEquals(expected, BeerSong.verses(8, 6))
|
51
60
|
}
|
52
61
|
|
62
|
+
@Ignore
|
53
63
|
@Test
|
54
64
|
fun songVerse3To0() {
|
55
65
|
val expected = "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n"
|
56
66
|
assertEquals(expected, BeerSong.verses(3, 0))
|
57
67
|
}
|
58
68
|
|
69
|
+
@Ignore
|
59
70
|
@Test
|
60
71
|
fun songVerse100To98() {
|
61
72
|
assertFailsWith(IllegalArgumentException::class, "Beer song only goes up to verse 99", { BeerSong.verses(100, 98) })
|
62
73
|
}
|
63
74
|
|
75
|
+
@Ignore
|
64
76
|
@Test
|
65
77
|
fun songVerse3ToMinus1() {
|
66
78
|
assertFailsWith(IllegalArgumentException::class, "Beer song can't go down into a negative verse", { BeerSong.verses(3, -1) })
|
67
79
|
}
|
68
80
|
|
81
|
+
@Ignore
|
69
82
|
@Test
|
70
83
|
fun entireSong() {
|
71
84
|
val expected =
|
@@ -1,44 +1,53 @@
|
|
1
1
|
|
2
2
|
import org.junit.Test
|
3
|
+
import org.junit.Ignore
|
3
4
|
import kotlin.test.assertEquals
|
4
5
|
|
5
6
|
class BinarySearchTest {
|
6
7
|
|
8
|
+
|
7
9
|
@Test(expected = IllegalArgumentException::class)
|
8
10
|
fun unsortedListCannotBeSearched() {
|
9
11
|
BinarySearch.search(listOf(1, 2, 4, 3), 1)
|
10
12
|
}
|
11
13
|
|
14
|
+
@Ignore
|
12
15
|
@Test
|
13
16
|
fun shouldReturnMinus1ForAValueNotPresentInTheList() {
|
14
17
|
assertEquals(-1, BinarySearch.search(listOf(1, 2, 3, 4), 5))
|
15
18
|
}
|
16
19
|
|
20
|
+
@Ignore
|
17
21
|
@Test
|
18
22
|
fun shouldFindTheItemInASingleElementList() {
|
19
23
|
assertEquals(0, BinarySearch.search(listOf(3), 3))
|
20
24
|
}
|
21
25
|
|
26
|
+
@Ignore
|
22
27
|
@Test
|
23
28
|
fun shouldFindTheFirstItemInATwoElementList() {
|
24
29
|
assertEquals(0, BinarySearch.search(listOf(4, 11), 4))
|
25
30
|
}
|
26
31
|
|
32
|
+
@Ignore
|
27
33
|
@Test
|
28
34
|
fun shouldFindTheLastItemInATwoElementList() {
|
29
35
|
assertEquals(1, BinarySearch.search(listOf(4, 11), 11))
|
30
36
|
}
|
31
37
|
|
38
|
+
@Ignore
|
32
39
|
@Test
|
33
40
|
fun shouldFindTheMidItemInAnOddLengthList() {
|
34
41
|
assertEquals(2, BinarySearch.search(listOf(4, 4, 7, 9, 11), 7))
|
35
42
|
}
|
36
43
|
|
44
|
+
@Ignore
|
37
45
|
@Test
|
38
46
|
fun shouldFindThePreMidItemInAnEvenLengthList() {
|
39
47
|
assertEquals(1, BinarySearch.search(listOf(4, 5, 9, 11), 5))
|
40
48
|
}
|
41
49
|
|
50
|
+
@Ignore
|
42
51
|
@Test
|
43
52
|
fun shouldFindThePostMidItemInAnEvenLengthList() {
|
44
53
|
assertEquals(2, BinarySearch.search(listOf(4, 5, 17, 29), 17))
|