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.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/delphi/exercises/beer-song/inputdata.txt +7 -0
  4. data/tracks/delphi/exercises/beer-song/uBeerSongExample.pas +12 -12
  5. data/tracks/delphi/exercises/beer-song/uBeerSongTests.pas +74 -59
  6. data/tracks/elixir/exercises/grains/example.exs +3 -2
  7. data/tracks/elixir/exercises/grains/grains_test.exs +24 -8
  8. data/tracks/go/exercises/binary-search/binary_search_test.go +8 -0
  9. data/tracks/go/exercises/binary-search/example.go +2 -0
  10. data/tracks/go/exercises/binary/binary_test.go +5 -2
  11. data/tracks/go/exercises/variable-length-quantity/example.go +2 -0
  12. data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +8 -0
  13. data/tracks/go/exercises/word-count/word_count_test.go +4 -1
  14. data/tracks/julia/config.json +26 -0
  15. data/tracks/julia/exercises/gigasecond/example.jl +1 -0
  16. data/tracks/julia/exercises/gigasecond/gigasecond.jl +3 -0
  17. data/tracks/julia/exercises/gigasecond/runtests.jl +15 -0
  18. data/tracks/julia/exercises/roman-numerals/example.jl +21 -0
  19. data/tracks/julia/exercises/roman-numerals/roman-numerals.jl +3 -0
  20. data/tracks/julia/exercises/roman-numerals/runtests.jl +37 -0
  21. data/tracks/julia/exercises/transpose/example.jl +20 -0
  22. data/tracks/julia/exercises/transpose/runtests.jl +212 -0
  23. data/tracks/julia/exercises/transpose/transpose.jl +3 -0
  24. data/tracks/kotlin/.travis.yml +5 -2
  25. data/tracks/kotlin/bin/{build.sh → unit-tests.sh} +8 -6
  26. data/tracks/kotlin/exercises/_template/build.gradle +6 -0
  27. data/tracks/kotlin/exercises/accumulate/build.gradle +6 -0
  28. data/tracks/kotlin/exercises/accumulate/src/test/kotlin/AccumulateTest.kt +7 -0
  29. data/tracks/kotlin/exercises/acronym/build.gradle +6 -0
  30. data/tracks/kotlin/exercises/acronym/src/test/kotlin/AcronymTest.kt +7 -0
  31. data/tracks/kotlin/exercises/allergies/build.gradle +6 -0
  32. data/tracks/kotlin/exercises/allergies/src/test/kotlin/AllergiesTest.kt +20 -0
  33. data/tracks/kotlin/exercises/anagram/build.gradle +6 -0
  34. data/tracks/kotlin/exercises/anagram/src/test/kotlin/AnagramTest.kt +11 -0
  35. data/tracks/kotlin/exercises/atbash-cipher/build.gradle +6 -0
  36. data/tracks/kotlin/exercises/atbash-cipher/src/test/kotlin/AtbashTest.kt +3 -0
  37. data/tracks/kotlin/exercises/beer-song/build.gradle +6 -0
  38. data/tracks/kotlin/exercises/beer-song/src/test/kotlin/BeerSongTest.kt +13 -0
  39. data/tracks/kotlin/exercises/binary-search/build.gradle +6 -0
  40. data/tracks/kotlin/exercises/binary-search/src/test/kotlin/BinarySearchTest.kt +9 -0
  41. data/tracks/kotlin/exercises/binary/build.gradle +6 -0
  42. data/tracks/kotlin/exercises/binary/src/test/kotlin/BinaryTest.kt +2 -0
  43. data/tracks/kotlin/exercises/bob/build.gradle +6 -0
  44. data/tracks/kotlin/exercises/bob/src/test/kotlin/BobTest.kt +19 -0
  45. data/tracks/kotlin/exercises/bracket-push/build.gradle +6 -0
  46. data/tracks/kotlin/exercises/bracket-push/src/test/kotlin/BracketPushTest.kt +2 -0
  47. data/tracks/kotlin/exercises/build.gradle +17 -1
  48. data/tracks/kotlin/exercises/change/build.gradle +6 -0
  49. data/tracks/kotlin/exercises/change/src/test/kotlin/ChangeTest.kt +9 -0
  50. data/tracks/kotlin/exercises/difference-of-squares/build.gradle +6 -0
  51. data/tracks/kotlin/exercises/difference-of-squares/src/test/kotlin/SquaresTest.kt +13 -1
  52. data/tracks/kotlin/exercises/etl/build.gradle +6 -0
  53. data/tracks/kotlin/exercises/etl/src/test/kotlin/ETLTest.kt +5 -0
  54. data/tracks/kotlin/exercises/flatten-array/build.gradle +6 -0
  55. data/tracks/kotlin/exercises/flatten-array/src/test/kotlin/FlattenerTest.kt +9 -1
  56. data/tracks/kotlin/exercises/gigasecond/build.gradle +6 -0
  57. data/tracks/kotlin/exercises/gigasecond/src/test/kotlin/GigasecondTest.kt +6 -0
  58. data/tracks/kotlin/exercises/grade-school/build.gradle +6 -0
  59. data/tracks/kotlin/exercises/grade-school/src/test/kotlin/SchoolTest.kt +8 -0
  60. data/tracks/kotlin/exercises/hamming/build.gradle +6 -0
  61. data/tracks/kotlin/exercises/hamming/src/test/kotlin/HammingTest.kt +10 -0
  62. data/tracks/kotlin/exercises/hello-world/build.gradle +6 -0
  63. data/tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt +6 -0
  64. data/tracks/kotlin/exercises/hexadecimal/build.gradle +6 -0
  65. data/tracks/kotlin/exercises/hexadecimal/src/test/kotlin/HexadecimalTest.kt +2 -0
  66. data/tracks/kotlin/exercises/isogram/build.gradle +6 -0
  67. data/tracks/kotlin/exercises/isogram/src/test/kotlin/IsogramTest.kt +2 -0
  68. data/tracks/kotlin/exercises/largest-series-product/build.gradle +6 -0
  69. data/tracks/kotlin/exercises/largest-series-product/src/test/kotlin/SeriesInvalidInputTest.kt +5 -0
  70. data/tracks/kotlin/exercises/largest-series-product/src/test/kotlin/SeriesValidInputTest.kt +2 -0
  71. data/tracks/kotlin/exercises/leap/build.gradle +6 -0
  72. data/tracks/kotlin/exercises/leap/src/test/kotlin/LeapTest.kt +8 -0
  73. data/tracks/kotlin/exercises/linked-list/build.gradle +6 -0
  74. data/tracks/kotlin/exercises/linked-list/src/test/kotlin/DequeTest.kt +6 -0
  75. data/tracks/kotlin/exercises/luhn/build.gradle +6 -0
  76. data/tracks/kotlin/exercises/luhn/src/test/kotlin/LuhnTest.kt +11 -0
  77. data/tracks/kotlin/exercises/nth-prime/build.gradle +6 -0
  78. data/tracks/kotlin/exercises/nth-prime/src/test/kotlin/PrimeTest.kt +6 -0
  79. data/tracks/kotlin/exercises/nucleotide-count/build.gradle +6 -0
  80. data/tracks/kotlin/exercises/nucleotide-count/src/test/kotlin/NucleotideTest.kt +12 -1
  81. data/tracks/kotlin/exercises/pangram/build.gradle +6 -0
  82. data/tracks/kotlin/exercises/pangram/src/test/kotlin/PangramTest.kt +11 -0
  83. data/tracks/kotlin/exercises/pascals-triangle/build.gradle +6 -0
  84. data/tracks/kotlin/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt +5 -0
  85. data/tracks/kotlin/exercises/phone-number/build.gradle +6 -0
  86. data/tracks/kotlin/exercises/phone-number/src/test/kotlin/PhoneNumberTest.kt +9 -0
  87. data/tracks/kotlin/exercises/pig-latin/build.gradle +6 -0
  88. data/tracks/kotlin/exercises/pig-latin/src/test/kotlin/PigLatinTest.kt +2 -0
  89. data/tracks/kotlin/exercises/raindrops/build.gradle +6 -0
  90. data/tracks/kotlin/exercises/raindrops/src/test/kotlin/RaindropsTest.kt +2 -0
  91. data/tracks/kotlin/exercises/rna-transcription/build.gradle +6 -0
  92. data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +8 -1
  93. data/tracks/kotlin/exercises/robot-name/build.gradle +6 -0
  94. data/tracks/kotlin/exercises/robot-name/src/test/kotlin/RobotTest.kt +4 -0
  95. data/tracks/kotlin/exercises/roman-numerals/build.gradle +6 -0
  96. data/tracks/kotlin/exercises/roman-numerals/src/test/kotlin/RomanNumeralTest.kt +2 -0
  97. data/tracks/kotlin/exercises/scrabble-score/build.gradle +6 -0
  98. data/tracks/kotlin/exercises/scrabble-score/src/test/kotlin/ScrabbleScoreTest.kt +2 -0
  99. data/tracks/kotlin/exercises/series/build.gradle +6 -0
  100. data/tracks/kotlin/exercises/series/src/test/kotlin/SeriesTest.kt +4 -0
  101. data/tracks/kotlin/exercises/sieve/build.gradle +6 -0
  102. data/tracks/kotlin/exercises/sieve/src/test/kotlin/SieveTest.kt +4 -0
  103. data/tracks/kotlin/exercises/simple-cipher/build.gradle +6 -0
  104. data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/IncorrectKeyCipherTest.kt +6 -0
  105. data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/RandomKeyCipherTest.kt +7 -0
  106. data/tracks/kotlin/exercises/simple-cipher/src/test/kotlin/SubstitutionCipherTest.kt +9 -0
  107. data/tracks/kotlin/exercises/space-age/build.gradle +6 -0
  108. data/tracks/kotlin/exercises/space-age/src/test/kotlin/SpaceAgeTest.kt +10 -0
  109. data/tracks/kotlin/exercises/strain/build.gradle +6 -0
  110. data/tracks/kotlin/exercises/strain/src/test/kotlin/StrainTest.kt +13 -0
  111. data/tracks/kotlin/exercises/word-count/build.gradle +6 -0
  112. data/tracks/kotlin/exercises/word-count/src/test/kotlin/WordCountTest.kt +8 -0
  113. data/tracks/objective-c/circle.yml +1 -1
  114. data/tracks/perl6/.travis.yml +2 -2
  115. data/tracks/perl6/config.json +5 -0
  116. data/tracks/perl6/docs/TESTS.md +78 -18
  117. data/tracks/perl6/exercises/allergies/{Example.p6 → Example.pm} +0 -0
  118. data/tracks/perl6/exercises/allergies/allergies.t +2 -7
  119. data/tracks/perl6/exercises/atbash-cipher/{Example.p6 → Example.pm} +0 -0
  120. data/tracks/perl6/exercises/atbash-cipher/cipher.t +2 -7
  121. data/tracks/perl6/exercises/linked-list/Example.pm6 +51 -0
  122. data/tracks/perl6/exercises/linked-list/linked-list.t +91 -0
  123. data/tracks/perl6/exercises/space-age/{Example.p6 → Example.pm} +0 -0
  124. data/tracks/perl6/exercises/space-age/space-age.t +2 -7
  125. data/tracks/perl6/exercises/trinary/{Example.p6 → Example.pm} +0 -0
  126. data/tracks/perl6/exercises/trinary/trinary.t +2 -7
  127. data/tracks/perl6/exercises/wordy/{Example.p6 → Example.pm} +0 -0
  128. data/tracks/perl6/exercises/wordy/wordy.t +2 -7
  129. data/tracks/pony/README.md +4 -27
  130. data/tracks/pony/config.json +16 -0
  131. data/tracks/pony/exercises/atbash-cipher/example.pony +40 -0
  132. data/tracks/pony/exercises/atbash-cipher/test.pony +67 -0
  133. data/tracks/pony/exercises/beer-song/example.pony +44 -0
  134. data/tracks/pony/exercises/beer-song/test.pony +27 -0
  135. data/tracks/pony/exercises/rna-transcription/test.pony +1 -1
  136. data/tracks/prolog/docs/INSTALLATION.md +1 -1
  137. data/tracks/prolog/docs/TESTS.md +2 -2
  138. metadata +24 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5a4eccbddd152c661534a7ae9a71ad4fd71f6ab
4
- data.tar.gz: 4d1ec7fec9f35886d314ad5bee617846f3395cd8
3
+ metadata.gz: 198b6fef8f99f08933a5950cece11d670f8c55d5
4
+ data.tar.gz: 60fe20d97d5d76d28013bc55f34e61af774c2545
5
5
  SHA512:
6
- metadata.gz: 56de61b12c3dd2fca7521f9ea629f5a0029d68a941156fa335f5f60ff466b19a1425da7eb528d89c18de8b11dfe5791cefc5d41a20fd3f7e2bb5b6d5acfa7d6c
7
- data.tar.gz: e94acef7c5f3926878c87cf57a3b5fb3ced167acfed7f3662943a0a4a2d934e163ef2dbb06f6811f63685aff89e8061eda64d8bf3869f199a1bf11df0a2ba94f
6
+ metadata.gz: d0e57fc07e060f60f97d7b63f4f65731b759237eb22005cffe9366506c74d9a4d3db12e69c34b14b437892cc909f6a60d6574f2cb32d98a9d05cb5c93c9abff2
7
+ data.tar.gz: 3bfc8af45d8823761ba9cd317f8de8e873fe178d4e8f4f8785c80582e24751b5d16219d29820b3af80df6f1f049a4859e6129610c9ad64c4b51c9779af0b3a2e
@@ -1,3 +1,3 @@
1
1
  module Trackler
2
- VERSION = "2.0.6.33"
2
+ VERSION = "2.0.6.34"
3
3
  end
@@ -0,0 +1,7 @@
1
+ 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
2
+ 44 bottles of beer on the wall, 44 bottles of beer.\nTake one down and pass it around, 43 bottles of beer on the wall.\n
3
+ 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
4
+ 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
5
+ 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
6
+ 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
7
+ 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\n98 bottles of beer on the wall, 98 bottles of beer.\nTake one down and pass it around, 97 bottles of beer on the wall.\n\n97 bottles of beer on the wall, 97 bottles of beer.\nTake one down and pass it around, 96 bottles of beer on the wall.\n\n96 bottles of beer on the wall, 96 bottles of beer.\nTake one down and pass it around, 95 bottles of beer on the wall.\n\n95 bottles of beer on the wall, 95 bottles of beer.\nTake one down and pass it around, 94 bottles of beer on the wall.\n\n94 bottles of beer on the wall, 94 bottles of beer.\nTake one down and pass it around, 93 bottles of beer on the wall.\n\n93 bottles of beer on the wall, 93 bottles of beer.\nTake one down and pass it around, 92 bottles of beer on the wall.\n\n92 bottles of beer on the wall, 92 bottles of beer.\nTake one down and pass it around, 91 bottles of beer on the wall.\n\n91 bottles of beer on the wall, 91 bottles of beer.\nTake one down and pass it around, 90 bottles of beer on the wall.\n\n90 bottles of beer on the wall, 90 bottles of beer.\nTake one down and pass it around, 89 bottles of beer on the wall.\n\n89 bottles of beer on the wall, 89 bottles of beer.\nTake one down and pass it around, 88 bottles of beer on the wall.\n\n88 bottles of beer on the wall, 88 bottles of beer.\nTake one down and pass it around, 87 bottles of beer on the wall.\n\n87 bottles of beer on the wall, 87 bottles of beer.\nTake one down and pass it around, 86 bottles of beer on the wall.\n\n86 bottles of beer on the wall, 86 bottles of beer.\nTake one down and pass it around, 85 bottles of beer on the wall.\n\n85 bottles of beer on the wall, 85 bottles of beer.\nTake one down and pass it around, 84 bottles of beer on the wall.\n\n84 bottles of beer on the wall, 84 bottles of beer.\nTake one down and pass it around, 83 bottles of beer on the wall.\n\n83 bottles of beer on the wall, 83 bottles of beer.\nTake one down and pass it around, 82 bottles of beer on the wall.\n\n82 bottles of beer on the wall, 82 bottles of beer.\nTake one down and pass it around, 81 bottles of beer on the wall.\n\n81 bottles of beer on the wall, 81 bottles of beer.\nTake one down and pass it around, 80 bottles of beer on the wall.\n\n80 bottles of beer on the wall, 80 bottles of beer.\nTake one down and pass it around, 79 bottles of beer on the wall.\n\n79 bottles of beer on the wall, 79 bottles of beer.\nTake one down and pass it around, 78 bottles of beer on the wall.\n\n78 bottles of beer on the wall, 78 bottles of beer.\nTake one down and pass it around, 77 bottles of beer on the wall.\n\n77 bottles of beer on the wall, 77 bottles of beer.\nTake one down and pass it around, 76 bottles of beer on the wall.\n\n76 bottles of beer on the wall, 76 bottles of beer.\nTake one down and pass it around, 75 bottles of beer on the wall.\n\n75 bottles of beer on the wall, 75 bottles of beer.\nTake one down and pass it around, 74 bottles of beer on the wall.\n\n74 bottles of beer on the wall, 74 bottles of beer.\nTake one down and pass it around, 73 bottles of beer on the wall.\n\n73 bottles of beer on the wall, 73 bottles of beer.\nTake one down and pass it around, 72 bottles of beer on the wall.\n\n72 bottles of beer on the wall, 72 bottles of beer.\nTake one down and pass it around, 71 bottles of beer on the wall.\n\n71 bottles of beer on the wall, 71 bottles of beer.\nTake one down and pass it around, 70 bottles of beer on the wall.\n\n70 bottles of beer on the wall, 70 bottles of beer.\nTake one down and pass it around, 69 bottles of beer on the wall.\n\n69 bottles of beer on the wall, 69 bottles of beer.\nTake one down and pass it around, 68 bottles of beer on the wall.\n\n68 bottles of beer on the wall, 68 bottles of beer.\nTake one down and pass it around, 67 bottles of beer on the wall.\n\n67 bottles of beer on the wall, 67 bottles of beer.\nTake one down and pass it around, 66 bottles of beer on the wall.\n\n66 bottles of beer on the wall, 66 bottles of beer.\nTake one down and pass it around, 65 bottles of beer on the wall.\n\n65 bottles of beer on the wall, 65 bottles of beer.\nTake one down and pass it around, 64 bottles of beer on the wall.\n\n64 bottles of beer on the wall, 64 bottles of beer.\nTake one down and pass it around, 63 bottles of beer on the wall.\n\n63 bottles of beer on the wall, 63 bottles of beer.\nTake one down and pass it around, 62 bottles of beer on the wall.\n\n62 bottles of beer on the wall, 62 bottles of beer.\nTake one down and pass it around, 61 bottles of beer on the wall.\n\n61 bottles of beer on the wall, 61 bottles of beer.\nTake one down and pass it around, 60 bottles of beer on the wall.\n\n60 bottles of beer on the wall, 60 bottles of beer.\nTake one down and pass it around, 59 bottles of beer on the wall.\n\n59 bottles of beer on the wall, 59 bottles of beer.\nTake one down and pass it around, 58 bottles of beer on the wall.\n\n58 bottles of beer on the wall, 58 bottles of beer.\nTake one down and pass it around, 57 bottles of beer on the wall.\n\n57 bottles of beer on the wall, 57 bottles of beer.\nTake one down and pass it around, 56 bottles of beer on the wall.\n\n56 bottles of beer on the wall, 56 bottles of beer.\nTake one down and pass it around, 55 bottles of beer on the wall.\n\n55 bottles of beer on the wall, 55 bottles of beer.\nTake one down and pass it around, 54 bottles of beer on the wall.\n\n54 bottles of beer on the wall, 54 bottles of beer.\nTake one down and pass it around, 53 bottles of beer on the wall.\n\n53 bottles of beer on the wall, 53 bottles of beer.\nTake one down and pass it around, 52 bottles of beer on the wall.\n\n52 bottles of beer on the wall, 52 bottles of beer.\nTake one down and pass it around, 51 bottles of beer on the wall.\n\n51 bottles of beer on the wall, 51 bottles of beer.\nTake one down and pass it around, 50 bottles of beer on the wall.\n\n50 bottles of beer on the wall, 50 bottles of beer.\nTake one down and pass it around, 49 bottles of beer on the wall.\n\n49 bottles of beer on the wall, 49 bottles of beer.\nTake one down and pass it around, 48 bottles of beer on the wall.\n\n48 bottles of beer on the wall, 48 bottles of beer.\nTake one down and pass it around, 47 bottles of beer on the wall.\n\n47 bottles of beer on the wall, 47 bottles of beer.\nTake one down and pass it around, 46 bottles of beer on the wall.\n\n46 bottles of beer on the wall, 46 bottles of beer.\nTake one down and pass it around, 45 bottles of beer on the wall.\n\n45 bottles of beer on the wall, 45 bottles of beer.\nTake one down and pass it around, 44 bottles of beer on the wall.\n\n44 bottles of beer on the wall, 44 bottles of beer.\nTake one down and pass it around, 43 bottles of beer on the wall.\n\n43 bottles of beer on the wall, 43 bottles of beer.\nTake one down and pass it around, 42 bottles of beer on the wall.\n\n42 bottles of beer on the wall, 42 bottles of beer.\nTake one down and pass it around, 41 bottles of beer on the wall.\n\n41 bottles of beer on the wall, 41 bottles of beer.\nTake one down and pass it around, 40 bottles of beer on the wall.\n\n40 bottles of beer on the wall, 40 bottles of beer.\nTake one down and pass it around, 39 bottles of beer on the wall.\n\n39 bottles of beer on the wall, 39 bottles of beer.\nTake one down and pass it around, 38 bottles of beer on the wall.\n\n38 bottles of beer on the wall, 38 bottles of beer.\nTake one down and pass it around, 37 bottles of beer on the wall.\n\n37 bottles of beer on the wall, 37 bottles of beer.\nTake one down and pass it around, 36 bottles of beer on the wall.\n\n36 bottles of beer on the wall, 36 bottles of beer.\nTake one down and pass it around, 35 bottles of beer on the wall.\n\n35 bottles of beer on the wall, 35 bottles of beer.\nTake one down and pass it around, 34 bottles of beer on the wall.\n\n34 bottles of beer on the wall, 34 bottles of beer.\nTake one down and pass it around, 33 bottles of beer on the wall.\n\n33 bottles of beer on the wall, 33 bottles of beer.\nTake one down and pass it around, 32 bottles of beer on the wall.\n\n32 bottles of beer on the wall, 32 bottles of beer.\nTake one down and pass it around, 31 bottles of beer on the wall.\n\n31 bottles of beer on the wall, 31 bottles of beer.\nTake one down and pass it around, 30 bottles of beer on the wall.\n\n30 bottles of beer on the wall, 30 bottles of beer.\nTake one down and pass it around, 29 bottles of beer on the wall.\n\n29 bottles of beer on the wall, 29 bottles of beer.\nTake one down and pass it around, 28 bottles of beer on the wall.\n\n28 bottles of beer on the wall, 28 bottles of beer.\nTake one down and pass it around, 27 bottles of beer on the wall.\n\n27 bottles of beer on the wall, 27 bottles of beer.\nTake one down and pass it around, 26 bottles of beer on the wall.\n\n26 bottles of beer on the wall, 26 bottles of beer.\nTake one down and pass it around, 25 bottles of beer on the wall.\n\n25 bottles of beer on the wall, 25 bottles of beer.\nTake one down and pass it around, 24 bottles of beer on the wall.\n\n24 bottles of beer on the wall, 24 bottles of beer.\nTake one down and pass it around, 23 bottles of beer on the wall.\n\n23 bottles of beer on the wall, 23 bottles of beer.\nTake one down and pass it around, 22 bottles of beer on the wall.\n\n22 bottles of beer on the wall, 22 bottles of beer.\nTake one down and pass it around, 21 bottles of beer on the wall.\n\n21 bottles of beer on the wall, 21 bottles of beer.\nTake one down and pass it around, 20 bottles of beer on the wall.\n\n20 bottles of beer on the wall, 20 bottles of beer.\nTake one down and pass it around, 19 bottles of beer on the wall.\n\n19 bottles of beer on the wall, 19 bottles of beer.\nTake one down and pass it around, 18 bottles of beer on the wall.\n\n18 bottles of beer on the wall, 18 bottles of beer.\nTake one down and pass it around, 17 bottles of beer on the wall.\n\n17 bottles of beer on the wall, 17 bottles of beer.\nTake one down and pass it around, 16 bottles of beer on the wall.\n\n16 bottles of beer on the wall, 16 bottles of beer.\nTake one down and pass it around, 15 bottles of beer on the wall.\n\n15 bottles of beer on the wall, 15 bottles of beer.\nTake one down and pass it around, 14 bottles of beer on the wall.\n\n14 bottles of beer on the wall, 14 bottles of beer.\nTake one down and pass it around, 13 bottles of beer on the wall.\n\n13 bottles of beer on the wall, 13 bottles of beer.\nTake one down and pass it around, 12 bottles of beer on the wall.\n\n12 bottles of beer on the wall, 12 bottles of beer.\nTake one down and pass it around, 11 bottles of beer on the wall.\n\n11 bottles of beer on the wall, 11 bottles of beer.\nTake one down and pass it around, 10 bottles of beer on the wall.\n\n10 bottles of beer on the wall, 10 bottles of beer.\nTake one down and pass it around, 9 bottles of beer on the wall.\n\n9 bottles of beer on the wall, 9 bottles of beer.\nTake one down and pass it around, 8 bottles of beer on the wall.\n\n8 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\n5 bottles of beer on the wall, 5 bottles of beer.\nTake one down and pass it around, 4 bottles of beer on the wall.\n\n4 bottles of beer on the wall, 4 bottles of beer.\nTake one down and pass it around, 3 bottles of beer on the wall.\n\n3 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
@@ -6,7 +6,7 @@ type
6
6
  Beer = class
7
7
  public
8
8
  class function Verse(number: integer): string; static;
9
- class function Sing(start, stop: integer): string; static;
9
+ class function Verses(start, stop: integer): string; static;
10
10
  end;
11
11
 
12
12
  implementation
@@ -16,30 +16,30 @@ class function Beer.Verse(number: integer): string;
16
16
  begin
17
17
  case number of
18
18
  0:
19
- result := 'No more bottles of beer on the wall, no more bottles of beer.' + sLineBreak +
20
- 'Go to the store and buy some more, 99 bottles of beer on the wall.' + sLineBreak;
19
+ result := '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';
21
20
 
22
21
  1:
23
- result := '1 bottle of beer on the wall, 1 bottle of beer.' + sLineBreak +
24
- 'Take it down and pass it around, no more bottles of beer on the wall.' + sLineBreak;
22
+ result := '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';
25
23
 
26
24
  2:
27
- result := '2 bottles of beer on the wall, 2 bottles of beer.' + sLineBreak +
28
- 'Take one down and pass it around, 1 bottle of beer on the wall.' + sLineBreak;
25
+ result := '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';
29
26
 
30
27
  else
31
- result := format('%d bottles of beer on the wall, %d bottles of beer.' + sLineBreak +
32
- 'Take one down and pass it around, %d bottles of beer on the wall.' + sLineBreak,
33
- [number, number, number - 1]);
28
+ result := format(
29
+ '%d bottles of beer on the wall, %d bottles of beer.\nTake one down and pass it around, %d bottles of beer on the wall.\n',
30
+ [number, number, number - 1]);
34
31
  end; //case
35
32
  end;
36
33
 
37
- class function Beer.Sing(start, stop: integer): string;
34
+ class function Beer.Verses(start, stop: integer): string;
38
35
  var i: integer;
39
36
  begin
40
37
  result := '';
41
38
  for i := start downto stop do
42
- result := result + Verse(i) + sLineBreak;
39
+ if i = stop then
40
+ result := result + Verse(i)
41
+ else
42
+ result := result + Verse(i) + '\n';
43
43
  end;
44
44
 
45
45
  end.
@@ -6,112 +6,127 @@ uses
6
6
 
7
7
  type
8
8
 
9
- [TestFixture]
10
- BeerSongTests = class(TObject)
9
+ [TestFixture('Return 1 verse')]
10
+ VerseTests = class(TObject)
11
11
  public
12
12
  [Test]
13
- procedure Verse_8;
13
+ procedure First_verse;
14
14
 
15
15
  [Test]
16
16
  [Ignore('Comment this line to run this test')]
17
- procedure Verse_2;
17
+ procedure Middle_verse;
18
18
 
19
19
  [Test]
20
20
  [Ignore('Comment this line to run this test')]
21
- procedure Verse_0;
21
+ procedure Third_to_last_verse;
22
22
 
23
23
  [Test]
24
24
  [Ignore('Comment this line to run this test')]
25
- procedure Verse_8_to_6;
25
+ procedure Penultimate_verse;
26
26
 
27
27
  [Test]
28
28
  [Ignore('Comment this line to run this test')]
29
- procedure Verse_3_to_0;
29
+ procedure Last_verse;
30
+ end;
31
+
32
+ [TextFixture('Return multiple verses')]
33
+ LyricsTests = class(TObject)
34
+ public
35
+ [Test]
36
+ [Ignore('Comment this line to run this test')]
37
+ procedure Last_4_verses;
38
+
39
+ [Test]
40
+ [Ignore('Comment this line to run this test')]
41
+ procedure All_verses;
30
42
  end;
31
43
 
32
44
  implementation
33
- uses System.SysUtils, uBeerSong;
34
-
35
- const verseResults: array[0..3] of string = ('8 bottles of beer on the wall, 8 bottles of beer.' + sLineBreak +
36
- 'Take one down and pass it around, 7 bottles of beer on the wall.' + sLineBreak,
37
-
38
- '2 bottles of beer on the wall, 2 bottles of beer.' + sLineBreak +
39
- 'Take one down and pass it around, 1 bottle of beer on the wall.' + sLineBreak,
40
-
41
- '1 bottle of beer on the wall, 1 bottle of beer.' + sLineBreak +
42
- 'Take it down and pass it around, no more bottles of beer on the wall.' + sLineBreak,
43
-
44
- 'No more bottles of beer on the wall, no more bottles of beer.' + sLineBreak +
45
- 'Go to the store and buy some more, 99 bottles of beer on the wall.' + sLineBreak);
46
-
47
- singResults: array[0..1] of string = ('8 bottles of beer on the wall, 8 bottles of beer.' + sLineBreak +
48
- 'Take one down and pass it around, 7 bottles of beer on the wall.' + sLineBreak +
49
- sLineBreak +
50
- '7 bottles of beer on the wall, 7 bottles of beer.' + sLineBreak +
51
- 'Take one down and pass it around, 6 bottles of beer on the wall.' + sLineBreak +
52
- sLineBreak +
53
- '6 bottles of beer on the wall, 6 bottles of beer.' + sLineBreak +
54
- 'Take one down and pass it around, 5 bottles of beer on the wall.' + sLineBreak +
55
- sLineBreak,
56
-
57
- '3 bottles of beer on the wall, 3 bottles of beer.' + sLineBreak +
58
- 'Take one down and pass it around, 2 bottles of beer on the wall.' + sLineBreak +
59
- sLineBreak +
60
- '2 bottles of beer on the wall, 2 bottles of beer.' + sLineBreak +
61
- 'Take one down and pass it around, 1 bottle of beer on the wall.' + sLineBreak +
62
- sLineBreak +
63
- '1 bottle of beer on the wall, 1 bottle of beer.' + sLineBreak +
64
- 'Take it down and pass it around, no more bottles of beer on the wall.' + sLineBreak +
65
- sLineBreak +
66
- 'No more bottles of beer on the wall, no more bottles of beer.' + sLineBreak +
67
- 'Go to the store and buy some more, 99 bottles of beer on the wall.' + sLineBreak +
68
- sLineBreak);
69
-
70
- procedure BeerSongTests.Verse_8;
45
+ uses System.SysUtils, System.Classes, uBeerSong;
46
+
47
+ var inputFile: TStringlist;
48
+
49
+ {$region 'Return 1 verse'}
50
+
51
+ procedure VerseTests.First_verse;
71
52
  var Expected,
72
53
  Actual: string;
73
54
  begin
74
- Expected := verseResults[0];
75
- Actual := Beer.Verse(8);
55
+ Expected := inputFile[0];
56
+ Actual := Beer.Verse(99);
76
57
  Assert.AreEqual(Expected, Actual);
77
58
  end;
78
59
 
79
- procedure BeerSongTests.Verse_2;
60
+ procedure VerseTests.Middle_verse;
80
61
  var Expected,
81
62
  Actual: string;
82
63
  begin
83
- Expected := verseResults[1];
64
+ Expected := inputFile[1];
65
+ Actual := Beer.Verse(44);
66
+ Assert.AreEqual(Expected, Actual);
67
+ end;
68
+
69
+ procedure VerseTests.Third_to_last_verse;
70
+ var Expected,
71
+ Actual: string;
72
+ begin
73
+ Expected := inputFile[2];
84
74
  Actual := Beer.Verse(2);
85
75
  Assert.AreEqual(Expected, Actual);
86
76
  end;
87
77
 
88
- procedure BeerSongTests.Verse_0;
78
+ procedure VerseTests.Penultimate_verse;
79
+ var Expected,
80
+ Actual: string;
81
+ begin
82
+ Expected := inputFile[3];
83
+ Actual := Beer.Verse(1);
84
+ assert.AreEqual(Expected, Actual);
85
+ end;
86
+
87
+ procedure VerseTests.Last_verse;
89
88
  var Expected,
90
89
  Actual: string;
91
90
  begin
92
- Expected := verseResults[3];
91
+ Expected := inputFile[4];
93
92
  Actual := Beer.Verse(0);
94
- Assert.AreEqual(Expected, Actual);
93
+ assert.AreEqual(Expected, Actual);
95
94
  end;
95
+ {$endregion}
96
+
97
+ {$region 'Return multiple verses'}
96
98
 
97
- procedure BeerSongTests.Verse_8_to_6;
99
+ procedure LyricsTests.Last_4_verses;
98
100
  var Expected,
99
101
  Actual: string;
100
102
  begin
101
- Expected := singResults[0];
102
- Actual := Beer.Sing(8, 6);
103
+ Expected := inputFile[5];
104
+ Actual := Beer.Verses(3,0);
103
105
  assert.AreEqual(Expected, Actual);
104
106
  end;
105
107
 
106
- procedure BeerSongTests.Verse_3_to_0;
108
+ procedure LyricsTests.All_verses;
107
109
  var Expected,
108
110
  Actual: string;
109
111
  begin
110
- Expected := singResults[1];
111
- Actual := Beer.Sing(3, 0);
112
+ Expected := inputFile[6];
113
+ Actual := Beer.Verses(99,0);
112
114
  assert.AreEqual(Expected, Actual);
113
115
  end;
114
116
 
117
+ {$endregion}
118
+
119
+ function loadInputData: TStringlist;
120
+ begin
121
+ result := TStringlist.Create;
122
+ result.LoadFromFile('inputdata.txt');
123
+ end;
124
+
115
125
  initialization
116
- TDUnitX.RegisterTestFixture(BeerSongTests);
126
+ inputFile := loadInputData;
127
+ TDUnitX.RegisterTestFixture(VerseTests);
128
+ TDUnitX.RegisterTestFixture(LyricsTests);
129
+
130
+ finalization
131
+ inputFile.DisposeOf;
117
132
  end.
@@ -1,5 +1,6 @@
1
1
  defmodule Grains do
2
2
  use Bitwise, only_operators: true
3
- def square(number), do: 1 <<< (number - 1)
4
- def total, do: Enum.reduce(1..64, 0, fn(n, acc) -> acc + square(n) end)
3
+ def square(number) when number in (1..64), do: { :ok, 1 <<< (number - 1) }
4
+ def square(_), do: { :error, "The requested square must be between 1 and 64 (inclusive)" }
5
+ def total, do: { :ok, Enum.reduce(1..64, 0, fn(n, acc) -> {:ok, sq} = square(n); acc + sq end) }
5
6
  end
@@ -16,41 +16,57 @@ defmodule GrainsTest do
16
16
 
17
17
  # @tag :pending
18
18
  test "square 1" do
19
- assert Grains.square(1) === 1
19
+ assert Grains.square(1) === { :ok, 1 }
20
20
  end
21
21
 
22
22
  @tag :pending
23
23
  test "square 2" do
24
- assert Grains.square(2) === 2
24
+ assert Grains.square(2) === { :ok, 2 }
25
25
  end
26
26
 
27
27
  @tag :pending
28
28
  test "square 3" do
29
- assert Grains.square(3) === 4
29
+ assert Grains.square(3) === { :ok, 4 }
30
30
  end
31
31
 
32
32
  @tag :pending
33
33
  test "square 4" do
34
- assert Grains.square(4) === 8
34
+ assert Grains.square(4) === { :ok, 8 }
35
35
  end
36
36
 
37
37
  @tag :pending
38
38
  test "square 16" do
39
- assert Grains.square(16) === 32768
39
+ assert Grains.square(16) === { :ok, 32768 }
40
40
  end
41
41
 
42
42
  @tag :pending
43
43
  test "square 32" do
44
- assert Grains.square(32) === 2147483648
44
+ assert Grains.square(32) === { :ok, 2147483648 }
45
45
  end
46
46
 
47
47
  @tag :pending
48
48
  test "square 64" do
49
- assert Grains.square(64) === 9223372036854775808
49
+ assert Grains.square(64) === { :ok, 9223372036854775808 }
50
50
  end
51
51
 
52
52
  @tag :pending
53
53
  test "total grains" do
54
- assert Grains.total === 18446744073709551615
54
+ assert Grains.total === { :ok, 18446744073709551615 }
55
55
  end
56
+
57
+ @tag :pending
58
+ test "square greater than 64 returns an error" do
59
+ assert Grains.square(65) === { :error, "The requested square must be between 1 and 64 (inclusive)" }
60
+ end
61
+
62
+ @tag :pending
63
+ test "negative square returns an error" do
64
+ assert Grains.square(-1) === { :error, "The requested square must be between 1 and 64 (inclusive)" }
65
+ end
66
+
67
+ @tag :pending
68
+ test "square 0 returns an error" do
69
+ assert Grains.square(0) === { :error, "The requested square must be between 1 and 64 (inclusive)" }
70
+ end
71
+
56
72
  end
@@ -25,6 +25,8 @@ import (
25
25
  "testing"
26
26
  )
27
27
 
28
+ const targetTestVersion = 1
29
+
28
30
  var testData = []struct {
29
31
  ref string
30
32
  slice []int
@@ -84,6 +86,12 @@ var testData = []struct {
84
86
  nil, 0, 0},
85
87
  }
86
88
 
89
+ func TestTestVersion(t *testing.T) {
90
+ if testVersion != targetTestVersion {
91
+ t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
92
+ }
93
+ }
94
+
87
95
  func TestSearchInts(t *testing.T) {
88
96
  for _, test := range testData {
89
97
  if !sort.IntsAreSorted(test.slice) {
@@ -2,6 +2,8 @@ package binarysearch
2
2
 
3
3
  import "fmt"
4
4
 
5
+ const testVersion = 1
6
+
5
7
  func SearchInts(s []int, k int) (i int) {
6
8
  for j := len(s); i < j; {
7
9
  if h := (i + j) / 2; s[h] < k {
@@ -38,10 +38,13 @@ var testCases = []struct {
38
38
  {"22", 0, false},
39
39
  }
40
40
 
41
- func TestParseBinary(t *testing.T) {
41
+ func TestTestVersion(t *testing.T) {
42
42
  if testVersion != targetTestVersion {
43
- t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
43
+ t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
44
44
  }
45
+ }
46
+
47
+ func TestParseBinary(t *testing.T) {
45
48
  for _, tt := range testCases {
46
49
  actual, err := ParseBinary(tt.binary)
47
50
  if tt.ok {
@@ -1,5 +1,7 @@
1
1
  package variablelengthquantity
2
2
 
3
+ const testVersion = 1
4
+
3
5
  // EncodeVarint returns the varint encoding of x.
4
6
  func EncodeVarint(x uint32) []byte {
5
7
  if x>>7 == 0 {
@@ -5,6 +5,8 @@ import (
5
5
  "testing"
6
6
  )
7
7
 
8
+ const targetTestVersion = 1
9
+
8
10
  var testCases = []struct {
9
11
  input []byte
10
12
  output uint32
@@ -23,6 +25,12 @@ var testCases = []struct {
23
25
  10: {[]byte{0x81, 0x10}, 144, 1},
24
26
  }
25
27
 
28
+ func TestTestVersion(t *testing.T) {
29
+ if testVersion != targetTestVersion {
30
+ t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
31
+ }
32
+ }
33
+
26
34
  func TestDecodeVarint(t *testing.T) {
27
35
  for i, tc := range testCases {
28
36
  o, size := DecodeVarint(tc.input)
@@ -7,10 +7,13 @@ import (
7
7
 
8
8
  const targetTestVersion = 3
9
9
 
10
- func TestWordCount(t *testing.T) {
10
+ func TestTestVersion(t *testing.T) {
11
11
  if testVersion != targetTestVersion {
12
12
  t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
13
13
  }
14
+ }
15
+
16
+ func TestWordCount(t *testing.T) {
14
17
  for _, tt := range testCases {
15
18
  expected := tt.output
16
19
  actual := WordCount(tt.input)
@@ -21,6 +21,13 @@
21
21
  "exceptions"
22
22
  ]
23
23
  },
24
+ {
25
+ "slug": "gigasecond",
26
+ "difficulty": 1,
27
+ "topics": [
28
+ "dates"
29
+ ]
30
+ },
24
31
  {
25
32
  "slug": "difference-of-squares",
26
33
  "difficulty": 1,
@@ -75,6 +82,15 @@
75
82
  "strings"
76
83
  ]
77
84
  },
85
+ {
86
+ "slug": "roman-numerals",
87
+ "difficulty": 1,
88
+ "topics": [
89
+ "control-flow (loops)",
90
+ "strings",
91
+ "mathematics"
92
+ ]
93
+ },
78
94
  {
79
95
  "slug": "anagram",
80
96
  "difficulty": 2,
@@ -116,6 +132,16 @@
116
132
  "mathematics"
117
133
  ]
118
134
  },
135
+ {
136
+ "slug": "transpose",
137
+ "difficulty": 2,
138
+ "topics": [
139
+ "control-flow (loops)",
140
+ "control-flow (conditionals)",
141
+ "arrays",
142
+ "strings"
143
+ ]
144
+ },
119
145
  {
120
146
  "slug": "secret-handshake",
121
147
  "difficulty": 2,