trackler 2.2.1.128 → 2.2.1.129

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/bracket-push/canonical-data.json +9 -1
  4. data/tracks/bash/config.json +3 -3
  5. data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +3 -1
  6. data/tracks/crystal/exercises/difference-of-squares/spec/difference_of_squares_spec.cr +9 -9
  7. data/tracks/csharp/config.json +12 -0
  8. data/tracks/csharp/exercises/Exercises.sln +7 -1
  9. data/tracks/csharp/exercises/yacht/Example.cs +71 -0
  10. data/tracks/csharp/exercises/yacht/README.md +34 -0
  11. data/tracks/csharp/exercises/yacht/Yacht.cs +26 -0
  12. data/tracks/csharp/exercises/yacht/Yacht.csproj +18 -0
  13. data/tracks/csharp/exercises/yacht/YachtTest.cs +162 -0
  14. data/tracks/csharp/generators/Exercises/Yacht.cs +20 -0
  15. data/tracks/dart/exercises/leap/lib/example.dart +4 -8
  16. data/tracks/dart/exercises/leap/lib/leap.dart +1 -1
  17. data/tracks/dart/exercises/leap/test/leap_test.dart +14 -16
  18. data/tracks/delphi/config.json +11 -0
  19. data/tracks/delphi/exercises/bracket-push/BracketPush.dpr +60 -0
  20. data/tracks/delphi/exercises/bracket-push/README.md +31 -0
  21. data/tracks/delphi/exercises/bracket-push/uBracketPushExample.pas +40 -0
  22. data/tracks/delphi/exercises/bracket-push/uBracketPushTest.pas +158 -0
  23. data/tracks/fsharp/config.json +18 -6
  24. data/tracks/fsharp/exercises/Exercises.sln +7 -1
  25. data/tracks/fsharp/exercises/accumulate/Accumulate.fsproj +2 -2
  26. data/tracks/fsharp/exercises/acronym/Acronym.fsproj +2 -2
  27. data/tracks/fsharp/exercises/all-your-base/AllYourBase.fsproj +2 -2
  28. data/tracks/fsharp/exercises/allergies/Allergies.fsproj +2 -2
  29. data/tracks/fsharp/exercises/alphametics/Alphametics.fsproj +2 -2
  30. data/tracks/fsharp/exercises/anagram/Anagram.fsproj +2 -2
  31. data/tracks/fsharp/exercises/armstrong-numbers/ArmstrongNumbers.fsproj +2 -2
  32. data/tracks/fsharp/exercises/atbash-cipher/AtbashCipher.fsproj +2 -2
  33. data/tracks/fsharp/exercises/bank-account/BankAccount.fsproj +2 -2
  34. data/tracks/fsharp/exercises/beer-song/BeerSong.fsproj +2 -2
  35. data/tracks/fsharp/exercises/binary/Binary.fsproj +2 -2
  36. data/tracks/fsharp/exercises/binary-search/BinarySearch.fsproj +2 -2
  37. data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTree.fsproj +2 -2
  38. data/tracks/fsharp/exercises/bob/Bob.fsproj +2 -2
  39. data/tracks/fsharp/exercises/book-store/BookStore.fsproj +2 -2
  40. data/tracks/fsharp/exercises/bowling/Bowling.fsproj +2 -2
  41. data/tracks/fsharp/exercises/bowling/BowlingTest.fs +15 -1
  42. data/tracks/fsharp/exercises/bracket-push/BracketPush.fsproj +2 -2
  43. data/tracks/fsharp/exercises/change/Change.fsproj +2 -2
  44. data/tracks/fsharp/exercises/circular-buffer/CircularBuffer.fsproj +2 -2
  45. data/tracks/fsharp/exercises/circular-buffer/CircularBufferTest.fs +1 -1
  46. data/tracks/fsharp/exercises/clock/Clock.fsproj +2 -2
  47. data/tracks/fsharp/exercises/collatz-conjecture/CollatzConjecture.fsproj +2 -2
  48. data/tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fsproj +2 -2
  49. data/tracks/fsharp/exercises/connect/Connect.fsproj +2 -2
  50. data/tracks/fsharp/exercises/crypto-square/CryptoSquare.fsproj +2 -2
  51. data/tracks/fsharp/exercises/custom-set/CustomSet.fsproj +2 -2
  52. data/tracks/fsharp/exercises/diamond/Diamond.fsproj +2 -2
  53. data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquares.fsproj +2 -2
  54. data/tracks/fsharp/exercises/diffie-hellman/DiffieHellman.fsproj +2 -2
  55. data/tracks/fsharp/exercises/dominoes/Dominoes.fsproj +2 -2
  56. data/tracks/fsharp/exercises/dot-dsl/DotDsl.fsproj +2 -2
  57. data/tracks/fsharp/exercises/error-handling/ErrorHandling.fsproj +2 -2
  58. data/tracks/fsharp/exercises/etl/Etl.fsproj +2 -2
  59. data/tracks/fsharp/exercises/food-chain/FoodChain.fsproj +2 -2
  60. data/tracks/fsharp/exercises/forth/Forth.fsproj +2 -2
  61. data/tracks/fsharp/exercises/forth/ForthTest.fs +1 -1
  62. data/tracks/fsharp/exercises/gigasecond/Gigasecond.fsproj +2 -2
  63. data/tracks/fsharp/exercises/go-counting/GoCounting.fsproj +2 -2
  64. data/tracks/fsharp/exercises/grade-school/GradeSchool.fsproj +2 -2
  65. data/tracks/fsharp/exercises/grains/Grains.fsproj +2 -2
  66. data/tracks/fsharp/exercises/grains/GrainsTest.fs +1 -1
  67. data/tracks/fsharp/exercises/grep/Grep.fsproj +2 -2
  68. data/tracks/fsharp/exercises/grep/GrepTest.fs +1 -1
  69. data/tracks/fsharp/exercises/hamming/Hamming.fsproj +2 -2
  70. data/tracks/fsharp/exercises/hangman/Hangman.fsproj +2 -2
  71. data/tracks/fsharp/exercises/hello-world/HelloWorld.fsproj +2 -2
  72. data/tracks/fsharp/exercises/hexadecimal/Hexadecimal.fsproj +2 -2
  73. data/tracks/fsharp/exercises/house/Example.fs +2 -2
  74. data/tracks/fsharp/exercises/house/House.fsproj +2 -2
  75. data/tracks/fsharp/exercises/house/HouseTest.fs +28 -211
  76. data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifier.fsproj +2 -2
  77. data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +2 -2
  78. data/tracks/fsharp/exercises/isogram/Isogram.fsproj +2 -2
  79. data/tracks/fsharp/exercises/isogram/IsogramTest.fs +1 -1
  80. data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fsproj +2 -2
  81. data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fsproj +2 -2
  82. data/tracks/fsharp/exercises/leap/Leap.fsproj +2 -2
  83. data/tracks/fsharp/exercises/ledger/Ledger.fsproj +2 -2
  84. data/tracks/fsharp/exercises/lens-person/LensPerson.fsproj +2 -2
  85. data/tracks/fsharp/exercises/linked-list/LinkedList.fsproj +2 -2
  86. data/tracks/fsharp/exercises/list-ops/ListOps.fsproj +2 -2
  87. data/tracks/fsharp/exercises/list-ops/ListOpsTest.fs +1 -1
  88. data/tracks/fsharp/exercises/luhn/Luhn.fsproj +2 -2
  89. data/tracks/fsharp/exercises/markdown/Markdown.fsproj +2 -2
  90. data/tracks/fsharp/exercises/matrix/Matrix.fsproj +2 -2
  91. data/tracks/fsharp/exercises/meetup/Meetup.fsproj +2 -2
  92. data/tracks/fsharp/exercises/minesweeper/Minesweeper.fsproj +2 -2
  93. data/tracks/fsharp/exercises/nth-prime/NthPrime.fsproj +2 -2
  94. data/tracks/fsharp/exercises/nucleotide-count/NucleotideCount.fsproj +2 -2
  95. data/tracks/fsharp/exercises/ocr-numbers/OcrNumbers.fsproj +2 -2
  96. data/tracks/fsharp/exercises/octal/Octal.fsproj +2 -2
  97. data/tracks/fsharp/exercises/palindrome-products/PalindromeProducts.fsproj +2 -2
  98. data/tracks/fsharp/exercises/pangram/Pangram.fsproj +2 -2
  99. data/tracks/fsharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.fsproj +2 -2
  100. data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fsproj +2 -2
  101. data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbers.fsproj +2 -2
  102. data/tracks/fsharp/exercises/phone-number/PhoneNumber.fsproj +2 -2
  103. data/tracks/fsharp/exercises/pig-latin/PigLatin.fsproj +2 -2
  104. data/tracks/fsharp/exercises/poker/Poker.fsproj +2 -2
  105. data/tracks/fsharp/exercises/pov/Pov.fsproj +2 -2
  106. data/tracks/fsharp/exercises/pov/PovTest.fs +2 -2
  107. data/tracks/fsharp/exercises/prime-factors/PrimeFactors.fsproj +2 -2
  108. data/tracks/fsharp/exercises/protein-translation/ProteinTranslation.fsproj +2 -2
  109. data/tracks/fsharp/exercises/proverb/Proverb.fsproj +2 -2
  110. data/tracks/fsharp/exercises/pythagorean-triplet/PythagoreanTriplet.fsproj +2 -2
  111. data/tracks/fsharp/exercises/queen-attack/QueenAttack.fsproj +2 -2
  112. data/tracks/fsharp/exercises/rail-fence-cipher/RailFenceCipher.fsproj +2 -2
  113. data/tracks/fsharp/exercises/raindrops/Raindrops.fsproj +2 -2
  114. data/tracks/fsharp/exercises/rational-numbers/RationalNumbers.fsproj +2 -2
  115. data/tracks/fsharp/exercises/react/Example.fs +1 -1
  116. data/tracks/fsharp/exercises/react/React.fsproj +2 -2
  117. data/tracks/fsharp/exercises/react/ReactTest.fs +14 -1
  118. data/tracks/fsharp/exercises/rectangles/Rectangles.fsproj +2 -2
  119. data/tracks/fsharp/exercises/reverse-string/ReverseString.fsproj +2 -2
  120. data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fsproj +2 -2
  121. data/tracks/fsharp/exercises/robot-name/RobotName.fsproj +2 -2
  122. data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fsproj +2 -2
  123. data/tracks/fsharp/exercises/roman-numerals/RomanNumerals.fsproj +2 -2
  124. data/tracks/fsharp/exercises/rotational-cipher/RotationalCipher.fsproj +2 -2
  125. data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncoding.fsproj +2 -2
  126. data/tracks/fsharp/exercises/saddle-points/SaddlePoints.fsproj +2 -2
  127. data/tracks/fsharp/exercises/say/Say.fsproj +2 -2
  128. data/tracks/fsharp/exercises/scale-generator/ScaleGenerator.fsproj +2 -2
  129. data/tracks/fsharp/exercises/scrabble-score/ScrabbleScore.fsproj +2 -2
  130. data/tracks/fsharp/exercises/secret-handshake/SecretHandshake.fsproj +2 -2
  131. data/tracks/fsharp/exercises/series/Series.fsproj +2 -2
  132. data/tracks/fsharp/exercises/sgf-parsing/SgfParsing.fsproj +2 -2
  133. data/tracks/fsharp/exercises/sieve/Sieve.fsproj +2 -2
  134. data/tracks/fsharp/exercises/simple-cipher/SimpleCipher.fsproj +2 -2
  135. data/tracks/fsharp/exercises/simple-linked-list/SimpleLinkedList.fsproj +2 -2
  136. data/tracks/fsharp/exercises/space-age/SpaceAge.fsproj +2 -2
  137. data/tracks/fsharp/exercises/spiral-matrix/SpiralMatrix.fsproj +2 -2
  138. data/tracks/fsharp/exercises/strain/Strain.fsproj +2 -2
  139. data/tracks/fsharp/exercises/sublist/Sublist.fsproj +2 -2
  140. data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiples.fsproj +2 -2
  141. data/tracks/fsharp/exercises/tournament/Tournament.fsproj +2 -2
  142. data/tracks/fsharp/exercises/transpose/Transpose.fsproj +2 -2
  143. data/tracks/fsharp/exercises/tree-building/TreeBuilding.fsproj +2 -2
  144. data/tracks/fsharp/exercises/triangle/Triangle.fsproj +2 -2
  145. data/tracks/fsharp/exercises/trinary/Trinary.fsproj +2 -2
  146. data/tracks/fsharp/exercises/twelve-days/TwelveDays.fsproj +2 -2
  147. data/tracks/fsharp/exercises/two-bucket/TwoBucket.fsproj +2 -2
  148. data/tracks/fsharp/exercises/two-fer/TwoFer.fsproj +2 -2
  149. data/tracks/fsharp/exercises/variable-length-quantity/VariableLengthQuantity.fsproj +2 -2
  150. data/tracks/fsharp/exercises/word-count/WordCount.fsproj +2 -2
  151. data/tracks/fsharp/exercises/word-search/WordSearch.fsproj +2 -2
  152. data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +1 -1
  153. data/tracks/fsharp/exercises/wordy/Wordy.fsproj +2 -2
  154. data/tracks/fsharp/exercises/yacht/Example.fs +65 -0
  155. data/tracks/fsharp/exercises/yacht/Program.fs +1 -0
  156. data/tracks/fsharp/exercises/yacht/README.md +34 -0
  157. data/tracks/fsharp/exercises/yacht/Yacht.fs +17 -0
  158. data/tracks/fsharp/exercises/yacht/Yacht.fsproj +23 -0
  159. data/tracks/fsharp/exercises/yacht/YachtTest.fs +113 -0
  160. data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzle.fsproj +2 -2
  161. data/tracks/fsharp/exercises/zipper/Zipper.fsproj +2 -2
  162. data/tracks/fsharp/generators/CanonicalData.fs +2 -20
  163. data/tracks/fsharp/generators/Common.fs +1 -1
  164. data/tracks/fsharp/generators/Generators.fs +24 -11
  165. data/tracks/fsharp/generators/Generators.fsproj +4 -4
  166. data/tracks/fsharp/generators/Options.fs +1 -1
  167. data/tracks/haskell/exercises/bracket-push/package.yaml +1 -1
  168. data/tracks/haskell/exercises/bracket-push/test/Tests.hs +4 -0
  169. data/tracks/java/config.json +13 -0
  170. data/tracks/java/exercises/dominoes/.meta/src/reference/java/ChainNotFoundException.java +5 -0
  171. data/tracks/java/exercises/dominoes/.meta/src/reference/java/Domino.java +30 -0
  172. data/tracks/java/exercises/dominoes/.meta/src/reference/java/Dominoes.java +67 -0
  173. data/tracks/java/exercises/dominoes/.meta/version +2 -0
  174. data/tracks/java/exercises/dominoes/README.md +29 -0
  175. data/tracks/java/exercises/dominoes/build.gradle +18 -0
  176. data/tracks/java/exercises/dominoes/src/main/java/ChainNotFoundException.java +5 -0
  177. data/tracks/java/exercises/dominoes/src/main/java/Domino.java +30 -0
  178. data/tracks/java/exercises/dominoes/src/test/java/DominoesTest.java +230 -0
  179. data/tracks/java/exercises/settings.gradle +1 -0
  180. data/tracks/javascript/.eslintignore +0 -1
  181. data/tracks/javascript/exercises/simple-cipher/example.js +4 -6
  182. data/tracks/javascript/exercises/simple-cipher/simple-cipher.spec.js +7 -3
  183. data/tracks/php/config.json +7 -7
  184. data/tracks/python/config.json +195 -188
  185. data/tracks/python/exercises/alphametics/alphametics_test.py +1 -0
  186. data/tracks/python/exercises/bank-account/README.md +20 -1
  187. data/tracks/python/exercises/go-counting/README.md +2 -0
  188. data/tracks/python/test/check-exercises.py +1 -1
  189. data/tracks/rust/_test/ensure-stubs-compile.sh +5 -0
  190. data/tracks/rust/config/exercise_readme.go.tmpl +1 -1
  191. data/tracks/rust/config.json +10 -0
  192. data/tracks/rust/exercises/accumulate/README.md +1 -1
  193. data/tracks/rust/exercises/acronym/README.md +1 -1
  194. data/tracks/rust/exercises/all-your-base/README.md +1 -1
  195. data/tracks/rust/exercises/all-your-base/example.rs +15 -5
  196. data/tracks/rust/exercises/all-your-base/src/lib.rs +8 -1
  197. data/tracks/rust/exercises/all-your-base/tests/all-your-base.rs +10 -5
  198. data/tracks/rust/exercises/allergies/README.md +1 -1
  199. data/tracks/rust/exercises/alphametics/README.md +1 -1
  200. data/tracks/rust/exercises/anagram/README.md +1 -1
  201. data/tracks/rust/exercises/armstrong-numbers/.gitignore +3 -0
  202. data/tracks/rust/exercises/armstrong-numbers/Cargo.toml +3 -0
  203. data/tracks/rust/exercises/armstrong-numbers/README.md +51 -0
  204. data/tracks/rust/exercises/armstrong-numbers/example.rs +7 -0
  205. data/tracks/rust/exercises/armstrong-numbers/src/lib.rs +3 -0
  206. data/tracks/rust/exercises/armstrong-numbers/tests/armstrong-numbers.rs +49 -0
  207. data/tracks/rust/exercises/atbash-cipher/README.md +1 -1
  208. data/tracks/rust/exercises/beer-song/README.md +1 -1
  209. data/tracks/rust/exercises/binary-search/README.md +1 -1
  210. data/tracks/rust/exercises/bob/README.md +1 -1
  211. data/tracks/rust/exercises/book-store/README.md +1 -1
  212. data/tracks/rust/exercises/bowling/README.md +1 -1
  213. data/tracks/rust/exercises/bowling/example.rs +13 -8
  214. data/tracks/rust/exercises/bowling/src/lib.rs +22 -0
  215. data/tracks/rust/exercises/bowling/tests/bowling.rs +31 -31
  216. data/tracks/rust/exercises/bracket-push/README.md +1 -1
  217. data/tracks/rust/exercises/circular-buffer/README.md +1 -1
  218. data/tracks/rust/exercises/clock/README.md +1 -1
  219. data/tracks/rust/exercises/collatz-conjecture/README.md +1 -1
  220. data/tracks/rust/exercises/crypto-square/README.md +1 -1
  221. data/tracks/rust/exercises/crypto-square/example.rs +11 -3
  222. data/tracks/rust/exercises/crypto-square/tests/crypto-square.rs +8 -16
  223. data/tracks/rust/exercises/custom-set/README.md +1 -1
  224. data/tracks/rust/exercises/custom-set/example.rs +17 -17
  225. data/tracks/rust/exercises/custom-set/tests/custom-set.rs +84 -84
  226. data/tracks/rust/exercises/decimal/README.md +1 -1
  227. data/tracks/rust/exercises/difference-of-squares/README.md +1 -1
  228. data/tracks/rust/exercises/diffie-hellman/README.md +1 -1
  229. data/tracks/rust/exercises/dominoes/README.md +1 -1
  230. data/tracks/rust/exercises/etl/README.md +1 -1
  231. data/tracks/rust/exercises/forth/README.md +1 -1
  232. data/tracks/rust/exercises/gigasecond/README.md +1 -1
  233. data/tracks/rust/exercises/grade-school/README.md +1 -1
  234. data/tracks/rust/exercises/grains/README.md +1 -1
  235. data/tracks/rust/exercises/hamming/README.md +1 -1
  236. data/tracks/rust/exercises/hello-world/README.md +1 -1
  237. data/tracks/rust/exercises/hexadecimal/README.md +1 -1
  238. data/tracks/rust/exercises/isbn-verifier/README.md +1 -1
  239. data/tracks/rust/exercises/isogram/README.md +1 -1
  240. data/tracks/rust/exercises/largest-series-product/README.md +1 -1
  241. data/tracks/rust/exercises/largest-series-product/example.rs +10 -4
  242. data/tracks/rust/exercises/largest-series-product/src/lib.rs +9 -0
  243. data/tracks/rust/exercises/largest-series-product/tests/largest-series-product.rs +3 -3
  244. data/tracks/rust/exercises/leap/README.md +1 -1
  245. data/tracks/rust/exercises/luhn/README.md +1 -1
  246. data/tracks/rust/exercises/luhn-from/README.md +1 -1
  247. data/tracks/rust/exercises/luhn-trait/README.md +1 -1
  248. data/tracks/rust/exercises/macros/.meta/ALLOWED_TO_NOT_COMPILE +2 -0
  249. data/tracks/rust/exercises/macros/README.md +1 -1
  250. data/tracks/rust/exercises/minesweeper/README.md +1 -1
  251. data/tracks/rust/exercises/nth-prime/README.md +1 -1
  252. data/tracks/rust/exercises/nucleotide-codons/README.md +1 -1
  253. data/tracks/rust/exercises/nucleotide-count/README.md +1 -1
  254. data/tracks/rust/exercises/ocr-numbers/README.md +1 -1
  255. data/tracks/rust/exercises/ocr-numbers/example.rs +14 -6
  256. data/tracks/rust/exercises/ocr-numbers/src/lib.rs +7 -1
  257. data/tracks/rust/exercises/ocr-numbers/tests/ocr-numbers.rs +2 -2
  258. data/tracks/rust/exercises/pangram/README.md +1 -1
  259. data/tracks/rust/exercises/parallel-letter-frequency/README.md +1 -1
  260. data/tracks/rust/exercises/pascals-triangle/README.md +1 -1
  261. data/tracks/rust/exercises/perfect-numbers/README.md +1 -1
  262. data/tracks/rust/exercises/phone-number/README.md +1 -1
  263. data/tracks/rust/exercises/pig-latin/README.md +1 -1
  264. data/tracks/rust/exercises/poker/README.md +1 -1
  265. data/tracks/rust/exercises/prime-factors/README.md +1 -1
  266. data/tracks/rust/exercises/protein-translation/README.md +1 -1
  267. data/tracks/rust/exercises/proverb/README.md +1 -1
  268. data/tracks/rust/exercises/pythagorean-triplet/README.md +1 -1
  269. data/tracks/rust/exercises/queen-attack/README.md +1 -1
  270. data/tracks/rust/exercises/raindrops/README.md +1 -1
  271. data/tracks/rust/exercises/react/README.md +1 -1
  272. data/tracks/rust/exercises/react/example.rs +27 -18
  273. data/tracks/rust/exercises/react/src/lib.rs +25 -10
  274. data/tracks/rust/exercises/react/tests/react.rs +113 -83
  275. data/tracks/rust/exercises/rectangles/README.md +1 -1
  276. data/tracks/rust/exercises/reverse-string/README.md +1 -1
  277. data/tracks/rust/exercises/rna-transcription/README.md +1 -1
  278. data/tracks/rust/exercises/robot-name/README.md +1 -1
  279. data/tracks/rust/exercises/robot-simulator/README.md +1 -1
  280. data/tracks/rust/exercises/roman-numerals/README.md +1 -1
  281. data/tracks/rust/exercises/rotational-cipher/README.md +1 -1
  282. data/tracks/rust/exercises/run-length-encoding/README.md +1 -1
  283. data/tracks/rust/exercises/saddle-points/README.md +1 -1
  284. data/tracks/rust/exercises/say/README.md +1 -1
  285. data/tracks/rust/exercises/scrabble-score/README.md +1 -1
  286. data/tracks/rust/exercises/series/README.md +1 -1
  287. data/tracks/rust/exercises/sieve/README.md +1 -1
  288. data/tracks/rust/exercises/simple-linked-list/README.md +1 -1
  289. data/tracks/rust/exercises/space-age/README.md +1 -1
  290. data/tracks/rust/exercises/sublist/README.md +1 -1
  291. data/tracks/rust/exercises/sum-of-multiples/README.md +1 -1
  292. data/tracks/rust/exercises/tournament/README.md +1 -1
  293. data/tracks/rust/exercises/triangle/README.md +1 -1
  294. data/tracks/rust/exercises/two-bucket/README.md +1 -1
  295. data/tracks/rust/exercises/variable-length-quantity/README.md +1 -1
  296. data/tracks/rust/exercises/word-count/README.md +1 -1
  297. data/tracks/rust/exercises/wordy/README.md +1 -1
  298. data/tracks/typescript/config.json +11 -0
  299. data/tracks/typescript/exercises/list-ops/README.md +35 -0
  300. data/tracks/typescript/exercises/list-ops/list-ops.example.ts +80 -0
  301. data/tracks/typescript/exercises/list-ops/list-ops.test.ts +117 -0
  302. data/tracks/typescript/exercises/list-ops/list-ops.ts +0 -0
  303. data/tracks/typescript/exercises/list-ops/package.json +36 -0
  304. data/tracks/typescript/exercises/list-ops/tsconfig.json +22 -0
  305. data/tracks/typescript/exercises/list-ops/tslint.json +127 -0
  306. data/tracks/typescript/exercises/list-ops/yarn.lock +2624 -0
  307. metadata +42 -3
  308. data/tracks/dart/exercises/leap/pubspec.lock +0 -293
@@ -4,43 +4,43 @@ use set::*;
4
4
 
5
5
  #[test]
6
6
  fn sets_with_no_elements_are_empty() {
7
- let set: CustomSet<()> = CustomSet::new(vec![]);
7
+ let set: CustomSet<()> = CustomSet::new(&[]);
8
8
  assert!(set.is_empty());
9
9
  }
10
10
 
11
11
  #[test]
12
12
  #[ignore]
13
13
  fn sets_with_elements_are_not_empty() {
14
- let set = CustomSet::new(vec![1]);
14
+ let set = CustomSet::new(&[1]);
15
15
  assert!(!set.is_empty());
16
16
  }
17
17
 
18
18
  #[test]
19
19
  #[ignore]
20
20
  fn nothing_is_contained_in_an_empty_set() {
21
- let set = CustomSet::new(vec![]);
21
+ let set = CustomSet::new(&[]);
22
22
  assert!(!set.contains(&1));
23
23
  }
24
24
 
25
25
  #[test]
26
26
  #[ignore]
27
27
  fn true_when_the_element_is_in_the_set() {
28
- let set = CustomSet::new(vec![1, 2, 3]);
28
+ let set = CustomSet::new(&[1, 2, 3]);
29
29
  assert!(set.contains(&1));
30
30
  }
31
31
 
32
32
  #[test]
33
33
  #[ignore]
34
34
  fn false_when_the_element_is_not_in_the_set() {
35
- let set = CustomSet::new(vec![1, 2, 3]);
35
+ let set = CustomSet::new(&[1, 2, 3]);
36
36
  assert!(!set.contains(&4));
37
37
  }
38
38
 
39
39
  #[test]
40
40
  #[ignore]
41
41
  fn empty_sets_are_subsets_of_each_other() {
42
- let set1: CustomSet<()> = CustomSet::new(vec![]);
43
- let set2: CustomSet<()> = CustomSet::new(vec![]);
42
+ let set1: CustomSet<()> = CustomSet::new(&[]);
43
+ let set2: CustomSet<()> = CustomSet::new(&[]);
44
44
  assert!(set1.is_subset(&set2));
45
45
  assert!(set2.is_subset(&set1));
46
46
  }
@@ -48,24 +48,24 @@ fn empty_sets_are_subsets_of_each_other() {
48
48
  #[test]
49
49
  #[ignore]
50
50
  fn empty_set_is_subset_of_non_empty_set() {
51
- let set1 = CustomSet::new(vec![]);
52
- let set2 = CustomSet::new(vec![1]);
51
+ let set1 = CustomSet::new(&[]);
52
+ let set2 = CustomSet::new(&[1]);
53
53
  assert!(set1.is_subset(&set2));
54
54
  }
55
55
 
56
56
  #[test]
57
57
  #[ignore]
58
58
  fn non_empty_set_is_not_subset_of_empty_set() {
59
- let set1 = CustomSet::new(vec![1]);
60
- let set2 = CustomSet::new(vec![]);
59
+ let set1 = CustomSet::new(&[1]);
60
+ let set2 = CustomSet::new(&[]);
61
61
  assert!(!set1.is_subset(&set2));
62
62
  }
63
63
 
64
64
  #[test]
65
65
  #[ignore]
66
66
  fn sets_with_same_elements_are_subsets() {
67
- let set1 = CustomSet::new(vec![1, 2, 3]);
68
- let set2 = CustomSet::new(vec![1, 2, 3]);
67
+ let set1 = CustomSet::new(&[1, 2, 3]);
68
+ let set2 = CustomSet::new(&[1, 2, 3]);
69
69
  assert!(set1.is_subset(&set2));
70
70
  assert!(set2.is_subset(&set1));
71
71
  }
@@ -73,24 +73,24 @@ fn sets_with_same_elements_are_subsets() {
73
73
  #[test]
74
74
  #[ignore]
75
75
  fn set_contained_in_other_set_is_a_subset() {
76
- let set1 = CustomSet::new(vec![1, 2, 3]);
77
- let set2 = CustomSet::new(vec![4, 1, 2, 3]);
76
+ let set1 = CustomSet::new(&[1, 2, 3]);
77
+ let set2 = CustomSet::new(&[4, 1, 2, 3]);
78
78
  assert!(set1.is_subset(&set2));
79
79
  }
80
80
 
81
81
  #[test]
82
82
  #[ignore]
83
83
  fn set_not_contained_in_other_set_is_not_a_subset_one() {
84
- let set1 = CustomSet::new(vec![1, 2, 3]);
85
- let set2 = CustomSet::new(vec![4, 1, 3]);
84
+ let set1 = CustomSet::new(&[1, 2, 3]);
85
+ let set2 = CustomSet::new(&[4, 1, 3]);
86
86
  assert!(!set1.is_subset(&set2));
87
87
  }
88
88
 
89
89
  #[test]
90
90
  #[ignore]
91
91
  fn empty_sets_are_disjoint_with_each_other() {
92
- let set1: CustomSet<()> = CustomSet::new(vec![]);
93
- let set2: CustomSet<()> = CustomSet::new(vec![]);
92
+ let set1: CustomSet<()> = CustomSet::new(&[]);
93
+ let set2: CustomSet<()> = CustomSet::new(&[]);
94
94
  assert!(set1.is_disjoint(&set2));
95
95
  assert!(set2.is_disjoint(&set1));
96
96
  }
@@ -98,24 +98,24 @@ fn empty_sets_are_disjoint_with_each_other() {
98
98
  #[test]
99
99
  #[ignore]
100
100
  fn empty_set_disjoint_with_non_empty_set() {
101
- let set1 = CustomSet::new(vec![]);
102
- let set2 = CustomSet::new(vec![1]);
101
+ let set1 = CustomSet::new(&[]);
102
+ let set2 = CustomSet::new(&[1]);
103
103
  assert!(set1.is_disjoint(&set2));
104
104
  }
105
105
 
106
106
  #[test]
107
107
  #[ignore]
108
108
  fn non_empty_set_disjoint_with_empty_set() {
109
- let set1 = CustomSet::new(vec![1]);
110
- let set2 = CustomSet::new(vec![]);
109
+ let set1 = CustomSet::new(&[1]);
110
+ let set2 = CustomSet::new(&[]);
111
111
  assert!(set1.is_disjoint(&set2));
112
112
  }
113
113
 
114
114
  #[test]
115
115
  #[ignore]
116
116
  fn sets_with_one_element_in_common_are_not_disjoint() {
117
- let set1 = CustomSet::new(vec![1, 2]);
118
- let set2 = CustomSet::new(vec![2, 3]);
117
+ let set1 = CustomSet::new(&[1, 2]);
118
+ let set2 = CustomSet::new(&[2, 3]);
119
119
  assert!(!set1.is_disjoint(&set2));
120
120
  assert!(!set2.is_disjoint(&set1));
121
121
  }
@@ -123,8 +123,8 @@ fn sets_with_one_element_in_common_are_not_disjoint() {
123
123
  #[test]
124
124
  #[ignore]
125
125
  fn sets_with_no_elements_in_common_are_disjoint() {
126
- let set1 = CustomSet::new(vec![1, 2]);
127
- let set2 = CustomSet::new(vec![3, 4]);
126
+ let set1 = CustomSet::new(&[1, 2]);
127
+ let set2 = CustomSet::new(&[3, 4]);
128
128
  assert!(set1.is_disjoint(&set2));
129
129
  assert!(set2.is_disjoint(&set1));
130
130
  }
@@ -132,169 +132,169 @@ fn sets_with_no_elements_in_common_are_disjoint() {
132
132
  #[test]
133
133
  #[ignore]
134
134
  fn empty_sets_are_equal() {
135
- let set1: CustomSet<()> = CustomSet::new(vec![]);
136
- let set2: CustomSet<()> = CustomSet::new(vec![]);
135
+ let set1: CustomSet<()> = CustomSet::new(&[]);
136
+ let set2: CustomSet<()> = CustomSet::new(&[]);
137
137
  assert_eq!(set1, set2);
138
138
  }
139
139
 
140
140
  #[test]
141
141
  #[ignore]
142
142
  fn empty_set_is_not_equal_to_a_non_empty_set() {
143
- let set1 = CustomSet::new(vec![]);
144
- let set2 = CustomSet::new(vec![1, 2, 3]);
143
+ let set1 = CustomSet::new(&[]);
144
+ let set2 = CustomSet::new(&[1, 2, 3]);
145
145
  assert_ne!(set1, set2);
146
146
  }
147
147
 
148
148
  #[test]
149
149
  #[ignore]
150
150
  fn non_empty_set_is_not_equal_to_an_empty_set() {
151
- let set1 = CustomSet::new(vec![1, 2, 3]);
152
- let set2 = CustomSet::new(vec![]);
151
+ let set1 = CustomSet::new(&[1, 2, 3]);
152
+ let set2 = CustomSet::new(&[]);
153
153
  assert_ne!(set1, set2);
154
154
  }
155
155
 
156
156
  #[test]
157
157
  #[ignore]
158
158
  fn sets_with_the_same_elements_are_equal() {
159
- let set1 = CustomSet::new(vec![1, 2]);
160
- let set2 = CustomSet::new(vec![2, 1]);
159
+ let set1 = CustomSet::new(&[1, 2]);
160
+ let set2 = CustomSet::new(&[2, 1]);
161
161
  assert_eq!(set1, set2);
162
162
  }
163
163
 
164
164
  #[test]
165
165
  #[ignore]
166
166
  fn sets_with_different_elements_are_not_equal() {
167
- let set1 = CustomSet::new(vec![1, 2, 3]);
168
- let set2 = CustomSet::new(vec![2, 1, 4]);
167
+ let set1 = CustomSet::new(&[1, 2, 3]);
168
+ let set2 = CustomSet::new(&[2, 1, 4]);
169
169
  assert_ne!(set1, set2);
170
170
  }
171
171
 
172
172
  #[test]
173
173
  #[ignore]
174
174
  fn add_to_empty_set() {
175
- let mut set = CustomSet::new(vec![]);
175
+ let mut set = CustomSet::new(&[]);
176
176
  set.add(3);
177
- assert_eq!(set, CustomSet::new(vec![3]));
177
+ assert_eq!(set, CustomSet::new(&[3]));
178
178
  }
179
179
 
180
180
  #[test]
181
181
  #[ignore]
182
182
  fn add_to_non_empty_set() {
183
- let mut set = CustomSet::new(vec![1, 2, 4]);
183
+ let mut set = CustomSet::new(&[1, 2, 4]);
184
184
  set.add(3);
185
- assert_eq!(set, CustomSet::new(vec![1, 2, 3, 4]));
185
+ assert_eq!(set, CustomSet::new(&[1, 2, 3, 4]));
186
186
  }
187
187
 
188
188
  #[test]
189
189
  #[ignore]
190
190
  fn add_existing_element() {
191
- let mut set = CustomSet::new(vec![1, 2, 3]);
191
+ let mut set = CustomSet::new(&[1, 2, 3]);
192
192
  set.add(3);
193
- assert_eq!(set, CustomSet::new(vec![1, 2, 3]));
193
+ assert_eq!(set, CustomSet::new(&[1, 2, 3]));
194
194
  }
195
195
 
196
196
  #[test]
197
197
  #[ignore]
198
198
  fn intersecting_empty_sets_return_empty_set() {
199
- let set1: CustomSet<()> = CustomSet::new(vec![]);
200
- let set2: CustomSet<()> = CustomSet::new(vec![]);
201
- assert_eq!(set1.intersection(&set2), CustomSet::new(vec![]));
199
+ let set1: CustomSet<()> = CustomSet::new(&[]);
200
+ let set2: CustomSet<()> = CustomSet::new(&[]);
201
+ assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
202
202
  }
203
203
 
204
204
  #[test]
205
205
  #[ignore]
206
206
  fn intersecting_empty_set_with_non_empty_returns_empty_set() {
207
- let set1 = CustomSet::new(vec![]);
208
- let set2 = CustomSet::new(vec![3, 2, 5]);
209
- assert_eq!(set1.intersection(&set2), CustomSet::new(vec![]));
207
+ let set1 = CustomSet::new(&[]);
208
+ let set2 = CustomSet::new(&[3, 2, 5]);
209
+ assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
210
210
  }
211
211
 
212
212
  #[test]
213
213
  #[ignore]
214
214
  fn intersecting_non_empty_set_with_empty_returns_empty_set() {
215
- let set1 = CustomSet::new(vec![1, 2, 3, 4]);
216
- let set2 = CustomSet::new(vec![]);
217
- assert_eq!(set1.intersection(&set2), CustomSet::new(vec![]));
215
+ let set1 = CustomSet::new(&[1, 2, 3, 4]);
216
+ let set2 = CustomSet::new(&[]);
217
+ assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
218
218
  }
219
219
 
220
220
  #[test]
221
221
  #[ignore]
222
222
  fn intersection_of_two_sets_with_no_shared_elements_is_an_empty_set() {
223
- let set1 = CustomSet::new(vec![1, 2, 3]);
224
- let set2 = CustomSet::new(vec![4, 5, 6]);
225
- assert_eq!(set1.intersection(&set2), CustomSet::new(vec![]));
226
- assert_eq!(set2.intersection(&set1), CustomSet::new(vec![]));
223
+ let set1 = CustomSet::new(&[1, 2, 3]);
224
+ let set2 = CustomSet::new(&[4, 5, 6]);
225
+ assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
226
+ assert_eq!(set2.intersection(&set1), CustomSet::new(&[]));
227
227
  }
228
228
 
229
229
  #[test]
230
230
  #[ignore]
231
231
  fn intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements() {
232
- let set1 = CustomSet::new(vec![1, 2, 3, 4]);
233
- let set2 = CustomSet::new(vec![3, 2, 5]);
234
- assert_eq!(set1.intersection(&set2), CustomSet::new(vec![2, 3]));
235
- assert_eq!(set2.intersection(&set1), CustomSet::new(vec![2, 3]));
232
+ let set1 = CustomSet::new(&[1, 2, 3, 4]);
233
+ let set2 = CustomSet::new(&[3, 2, 5]);
234
+ assert_eq!(set1.intersection(&set2), CustomSet::new(&[2, 3]));
235
+ assert_eq!(set2.intersection(&set1), CustomSet::new(&[2, 3]));
236
236
  }
237
237
 
238
238
  #[test]
239
239
  #[ignore]
240
240
  fn difference_of_two_empty_sets_is_empty_set() {
241
- let set1: CustomSet<()> = CustomSet::new(vec![]);
242
- let set2: CustomSet<()> = CustomSet::new(vec![]);
243
- assert_eq!(set1.difference(&set2), CustomSet::new(vec![]));
241
+ let set1: CustomSet<()> = CustomSet::new(&[]);
242
+ let set2: CustomSet<()> = CustomSet::new(&[]);
243
+ assert_eq!(set1.difference(&set2), CustomSet::new(&[]));
244
244
  }
245
245
 
246
246
  #[test]
247
247
  #[ignore]
248
248
  fn difference_of_an_empty_and_non_empty_set_is_an_empty_set() {
249
- let set1 = CustomSet::new(vec![]);
250
- let set2 = CustomSet::new(vec![3, 2, 5]);
251
- assert_eq!(set1.difference(&set2), CustomSet::new(vec![]));
249
+ let set1 = CustomSet::new(&[]);
250
+ let set2 = CustomSet::new(&[3, 2, 5]);
251
+ assert_eq!(set1.difference(&set2), CustomSet::new(&[]));
252
252
  }
253
253
 
254
254
  #[test]
255
255
  #[ignore]
256
256
  fn difference_of_a_non_empty_set_and_empty_set_is_the_non_empty_set() {
257
- let set1 = CustomSet::new(vec![1, 2, 3, 4]);
258
- let set2 = CustomSet::new(vec![]);
259
- assert_eq!(set1.difference(&set2), CustomSet::new(vec![1, 2, 3, 4]));
257
+ let set1 = CustomSet::new(&[1, 2, 3, 4]);
258
+ let set2 = CustomSet::new(&[]);
259
+ assert_eq!(set1.difference(&set2), CustomSet::new(&[1, 2, 3, 4]));
260
260
  }
261
261
 
262
262
  #[test]
263
263
  #[ignore]
264
264
  fn difference_of_two_non_empty_sets_is_elements_only_in_first_set_one() {
265
- let set1 = CustomSet::new(vec![3, 2, 1]);
266
- let set2 = CustomSet::new(vec![2, 4]);
267
- assert_eq!(set1.difference(&set2), CustomSet::new(vec![1, 3]));
265
+ let set1 = CustomSet::new(&[3, 2, 1]);
266
+ let set2 = CustomSet::new(&[2, 4]);
267
+ assert_eq!(set1.difference(&set2), CustomSet::new(&[1, 3]));
268
268
  }
269
269
 
270
270
  #[test]
271
271
  #[ignore]
272
272
  fn union_of_two_empty_sets_is_empty_set() {
273
- let set1: CustomSet<()> = CustomSet::new(vec![]);
274
- let set2: CustomSet<()> = CustomSet::new(vec![]);
275
- assert_eq!(set1.union(&set2), CustomSet::new(vec![]));
273
+ let set1: CustomSet<()> = CustomSet::new(&[]);
274
+ let set2: CustomSet<()> = CustomSet::new(&[]);
275
+ assert_eq!(set1.union(&set2), CustomSet::new(&[]));
276
276
  }
277
277
 
278
278
  #[test]
279
279
  #[ignore]
280
280
  fn union_of_empty_set_and_non_empty_set_is_all_elements() {
281
- let set1 = CustomSet::new(vec![]);
282
- let set2 = CustomSet::new(vec![2]);
283
- assert_eq!(set1.union(&set2), CustomSet::new(vec![2]));
281
+ let set1 = CustomSet::new(&[]);
282
+ let set2 = CustomSet::new(&[2]);
283
+ assert_eq!(set1.union(&set2), CustomSet::new(&[2]));
284
284
  }
285
285
 
286
286
  #[test]
287
287
  #[ignore]
288
288
  fn union_of_non_empty_set_and_empty_set_is_the_non_empty_set() {
289
- let set1 = CustomSet::new(vec![1, 3]);
290
- let set2 = CustomSet::new(vec![]);
291
- assert_eq!(set1.union(&set2), CustomSet::new(vec![1, 3]));
289
+ let set1 = CustomSet::new(&[1, 3]);
290
+ let set2 = CustomSet::new(&[]);
291
+ assert_eq!(set1.union(&set2), CustomSet::new(&[1, 3]));
292
292
  }
293
293
 
294
294
  #[test]
295
295
  #[ignore]
296
296
  fn union_of_non_empty_sets_contains_all_unique_elements() {
297
- let set1 = CustomSet::new(vec![1, 3]);
298
- let set2 = CustomSet::new(vec![2, 3]);
299
- assert_eq!(set1.union(&set2), CustomSet::new(vec![3, 2, 1]));
297
+ let set1 = CustomSet::new(&[1, 3]);
298
+ let set2 = CustomSet::new(&[2, 3]);
299
+ assert_eq!(set1.union(&set2), CustomSet::new(&[3, 2, 1]));
300
300
  }
@@ -44,7 +44,7 @@ haven't already, it will help you with organizing your files.
44
44
 
45
45
  ## Feedback, Issues, Pull Requests
46
46
 
47
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
47
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
48
48
 
49
49
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
50
50
 
@@ -36,7 +36,7 @@ haven't already, it will help you with organizing your files.
36
36
 
37
37
  ## Feedback, Issues, Pull Requests
38
38
 
39
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
39
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
40
40
 
41
41
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
42
42
 
@@ -61,7 +61,7 @@ haven't already, it will help you with organizing your files.
61
61
 
62
62
  ## Feedback, Issues, Pull Requests
63
63
 
64
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
64
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
65
65
 
66
66
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
67
67
 
@@ -38,7 +38,7 @@ haven't already, it will help you with organizing your files.
38
38
 
39
39
  ## Feedback, Issues, Pull Requests
40
40
 
41
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
41
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
42
42
 
43
43
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
44
44
 
@@ -70,7 +70,7 @@ haven't already, it will help you with organizing your files.
70
70
 
71
71
  ## Feedback, Issues, Pull Requests
72
72
 
73
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
73
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
74
74
 
75
75
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
76
76
 
@@ -49,7 +49,7 @@ haven't already, it will help you with organizing your files.
49
49
 
50
50
  ## Feedback, Issues, Pull Requests
51
51
 
52
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
52
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
53
53
 
54
54
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
55
55
 
@@ -31,7 +31,7 @@ haven't already, it will help you with organizing your files.
31
31
 
32
32
  ## Feedback, Issues, Pull Requests
33
33
 
34
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
34
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
35
35
 
36
36
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
37
37
 
@@ -58,7 +58,7 @@ haven't already, it will help you with organizing your files.
58
58
 
59
59
  ## Feedback, Issues, Pull Requests
60
60
 
61
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
61
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
62
62
 
63
63
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
64
64
 
@@ -50,7 +50,7 @@ haven't already, it will help you with organizing your files.
50
50
 
51
51
  ## Feedback, Issues, Pull Requests
52
52
 
53
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
53
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
54
54
 
55
55
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
56
56
 
@@ -59,7 +59,7 @@ haven't already, it will help you with organizing your files.
59
59
 
60
60
  ## Feedback, Issues, Pull Requests
61
61
 
62
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
62
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
63
63
 
64
64
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
65
65
 
@@ -38,7 +38,7 @@ haven't already, it will help you with organizing your files.
38
38
 
39
39
  ## Feedback, Issues, Pull Requests
40
40
 
41
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
41
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
42
42
 
43
43
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
44
44
 
@@ -31,7 +31,7 @@ haven't already, it will help you with organizing your files.
31
31
 
32
32
  ## Feedback, Issues, Pull Requests
33
33
 
34
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
34
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
35
35
 
36
36
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
37
37
 
@@ -64,7 +64,7 @@ haven't already, it will help you with organizing your files.
64
64
 
65
65
  ## Feedback, Issues, Pull Requests
66
66
 
67
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
67
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
68
68
 
69
69
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
70
70
 
@@ -37,7 +37,7 @@ haven't already, it will help you with organizing your files.
37
37
 
38
38
  ## Feedback, Issues, Pull Requests
39
39
 
40
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
40
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
41
41
 
42
42
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
43
43
 
@@ -45,7 +45,7 @@ haven't already, it will help you with organizing your files.
45
45
 
46
46
  ## Feedback, Issues, Pull Requests
47
47
 
48
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
48
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
49
49
 
50
50
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
51
51
 
@@ -1,10 +1,16 @@
1
- pub fn lsp(string_digits: &str, span: usize) -> Result<u64, String> {
1
+ #[derive(Debug, PartialEq)]
2
+ pub enum Error {
3
+ SpanTooLong,
4
+ InvalidDigit(char),
5
+ }
6
+
7
+ pub fn lsp(string_digits: &str, span: usize) -> Result<u64, Error> {
2
8
  if span == 0 {
3
9
  return Ok(1);
4
10
  }
5
11
 
6
- if string_digits.chars().any(|c| !c.is_digit(10)) {
7
- return Err(String::from("All characters must be numbers"));
12
+ if let Some(invalid) = string_digits.chars().find(|c| !c.is_digit(10)) {
13
+ return Err(Error::InvalidDigit(invalid));
8
14
  }
9
15
 
10
16
  let products: Vec<u64> = string_digits.chars()
@@ -17,6 +23,6 @@ pub fn lsp(string_digits: &str, span: usize) -> Result<u64, String> {
17
23
  if let Some(&x) = products.iter().max() {
18
24
  Ok(x)
19
25
  } else {
20
- Err(String::from("Span longer than string"))
26
+ Err(Error::SpanTooLong)
21
27
  }
22
28
  }
@@ -0,0 +1,9 @@
1
+ #[derive(Debug, PartialEq)]
2
+ pub enum Error {
3
+ SpanTooLong,
4
+ InvalidDigit(char),
5
+ }
6
+
7
+ pub fn lsp(string_digits: &str, span: usize) -> Result<u64, Error> {
8
+ unimplemented!("largest series product of a span of {} digits in {}", span, string_digits);
9
+ }
@@ -65,7 +65,7 @@ fn returns_zero_if_all_products_are_zero() {
65
65
  #[test]
66
66
  #[ignore]
67
67
  fn a_span_is_longer_than_number_is_an_error() {
68
- assert!(lsp("123", 4).is_err());
68
+ assert_eq!(Err(Error::SpanTooLong), lsp("123", 4));
69
69
  }
70
70
 
71
71
  // There may be some confusion about whether this should be 1 or error.
@@ -95,11 +95,11 @@ fn a_non_empty_string_and_no_span_returns_one() {
95
95
  #[test]
96
96
  #[ignore]
97
97
  fn empty_string_and_non_zero_span_is_an_error() {
98
- assert!(lsp("", 1).is_err());
98
+ assert_eq!(Err(Error::SpanTooLong), lsp("", 1));
99
99
  }
100
100
 
101
101
  #[test]
102
102
  #[ignore]
103
103
  fn a_string_with_non_digits_is_an_error() {
104
- assert!(lsp("1234a5", 2).is_err());
104
+ assert_eq!(Err(Error::InvalidDigit('a')), lsp("1234a5", 2));
105
105
  }
@@ -50,7 +50,7 @@ haven't already, it will help you with organizing your files.
50
50
 
51
51
  ## Feedback, Issues, Pull Requests
52
52
 
53
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
53
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
54
54
 
55
55
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
56
56
 
@@ -88,7 +88,7 @@ haven't already, it will help you with organizing your files.
88
88
 
89
89
  ## Feedback, Issues, Pull Requests
90
90
 
91
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
91
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
92
92
 
93
93
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
94
94
 
@@ -34,7 +34,7 @@ haven't already, it will help you with organizing your files.
34
34
 
35
35
  ## Feedback, Issues, Pull Requests
36
36
 
37
- The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
37
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
38
38
 
39
39
  If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
40
40