trackler 2.2.1.171 → 2.2.1.172

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/go/exercises/dominoes/.meta/gen.go +1 -1
  4. data/tracks/go/exercises/dominoes/cases_test.go +11 -11
  5. data/tracks/ocaml/config.json +1 -1
  6. data/tracks/ocaml/docs/ABOUT.md +6 -4
  7. data/tracks/powershell/config.json +3 -2
  8. data/tracks/rust/bin/format_exercises +31 -0
  9. data/tracks/rust/config.json +10 -2
  10. data/tracks/rust/config/exercise_readme.go.tmpl +26 -5
  11. data/tracks/rust/exercises/accumulate/README.md +26 -5
  12. data/tracks/rust/exercises/accumulate/src/lib.rs +1 -0
  13. data/tracks/rust/exercises/accumulate/tests/accumulate.rs +7 -7
  14. data/tracks/rust/exercises/acronym/README.md +26 -5
  15. data/tracks/rust/exercises/acronym/src/lib.rs +1 -0
  16. data/tracks/rust/exercises/acronym/tests/acronym.rs +10 -5
  17. data/tracks/rust/exercises/all-your-base/README.md +26 -5
  18. data/tracks/rust/exercises/all-your-base/src/lib.rs +6 -1
  19. data/tracks/rust/exercises/all-your-base/tests/all-your-base.rs +68 -34
  20. data/tracks/rust/exercises/allergies/README.md +26 -5
  21. data/tracks/rust/exercises/allergies/src/lib.rs +1 -0
  22. data/tracks/rust/exercises/allergies/tests/allergies.rs +34 -26
  23. data/tracks/rust/exercises/alphametics/README.md +26 -5
  24. data/tracks/rust/exercises/alphametics/tests/alphametics.rs +44 -9
  25. data/tracks/rust/exercises/anagram/README.md +26 -5
  26. data/tracks/rust/exercises/anagram/src/lib.rs +1 -0
  27. data/tracks/rust/exercises/anagram/tests/anagram.rs +15 -4
  28. data/tracks/rust/exercises/armstrong-numbers/README.md +26 -5
  29. data/tracks/rust/exercises/atbash-cipher/README.md +26 -5
  30. data/tracks/rust/exercises/atbash-cipher/src/lib.rs +1 -1
  31. data/tracks/rust/exercises/atbash-cipher/tests/atbash-cipher.rs +16 -8
  32. data/tracks/rust/exercises/beer-song/README.md +26 -5
  33. data/tracks/rust/exercises/binary-search/README.md +26 -5
  34. data/tracks/rust/exercises/binary-search/src/lib.rs +1 -0
  35. data/tracks/rust/exercises/binary-search/tests/binary-search.rs +8 -4
  36. data/tracks/rust/exercises/bob/README.md +26 -5
  37. data/tracks/rust/exercises/bob/tests/bob.rs +32 -15
  38. data/tracks/rust/exercises/book-store/README.md +26 -5
  39. data/tracks/rust/exercises/book-store/src/lib.rs +4 -1
  40. data/tracks/rust/exercises/book-store/tests/book-store.rs +52 -24
  41. data/tracks/rust/exercises/bowling/README.md +26 -5
  42. data/tracks/rust/exercises/bowling/src/lib.rs +1 -2
  43. data/tracks/rust/exercises/bowling/tests/bowling.rs +2 -1
  44. data/tracks/rust/exercises/bracket-push/README.md +29 -7
  45. data/tracks/rust/exercises/bracket-push/src/lib.rs +1 -0
  46. data/tracks/rust/exercises/circular-buffer/README.md +26 -5
  47. data/tracks/rust/exercises/circular-buffer/src/lib.rs +1 -0
  48. data/tracks/rust/exercises/clock/README.md +26 -5
  49. data/tracks/rust/exercises/clock/src/lib.rs +1 -0
  50. data/tracks/rust/exercises/clock/tests/clock.rs +0 -1
  51. data/tracks/rust/exercises/collatz-conjecture/README.md +26 -5
  52. data/tracks/rust/exercises/crypto-square/README.md +53 -29
  53. data/tracks/rust/exercises/custom-set/README.md +26 -5
  54. data/tracks/rust/exercises/custom-set/src/lib.rs +1 -0
  55. data/tracks/rust/exercises/decimal/README.md +26 -5
  56. data/tracks/rust/exercises/decimal/tests/decimal.rs +4 -7
  57. data/tracks/rust/exercises/diamond/README.md +26 -5
  58. data/tracks/rust/exercises/difference-of-squares/README.md +26 -5
  59. data/tracks/rust/exercises/difference-of-squares/src/lib.rs +1 -1
  60. data/tracks/rust/exercises/diffie-hellman/README.md +26 -5
  61. data/tracks/rust/exercises/diffie-hellman/src/lib.rs +12 -2
  62. data/tracks/rust/exercises/diffie-hellman/tests/diffie-hellman.rs +3 -3
  63. data/tracks/rust/exercises/dominoes/README.md +26 -5
  64. data/tracks/rust/exercises/dominoes/src/lib.rs +1 -0
  65. data/tracks/rust/exercises/dominoes/tests/dominoes.rs +29 -13
  66. data/tracks/rust/exercises/etl/README.md +26 -5
  67. data/tracks/rust/exercises/etl/src/lib.rs +1 -0
  68. data/tracks/rust/exercises/etl/tests/etl.rs +39 -34
  69. data/tracks/rust/exercises/forth/README.md +26 -5
  70. data/tracks/rust/exercises/forth/tests/forth.rs +17 -65
  71. data/tracks/rust/exercises/gigasecond/README.md +26 -5
  72. data/tracks/rust/exercises/gigasecond/tests/gigasecond.rs +31 -10
  73. data/tracks/rust/exercises/grade-school/README.md +26 -5
  74. data/tracks/rust/exercises/grade-school/src/lib.rs +1 -2
  75. data/tracks/rust/exercises/grade-school/tests/grade-school.rs +5 -9
  76. data/tracks/rust/exercises/grains/README.md +26 -5
  77. data/tracks/rust/exercises/hamming/README.md +30 -8
  78. data/tracks/rust/exercises/hamming/src/lib.rs +1 -2
  79. data/tracks/rust/exercises/hello-world/README.md +26 -5
  80. data/tracks/rust/exercises/hexadecimal/README.md +26 -5
  81. data/tracks/rust/exercises/hexadecimal/src/lib.rs +1 -0
  82. data/tracks/rust/exercises/isbn-verifier/README.md +26 -5
  83. data/tracks/rust/exercises/isogram/README.md +26 -5
  84. data/tracks/rust/exercises/isogram/src/lib.rs +1 -1
  85. data/tracks/rust/exercises/isogram/tests/isogram.rs +36 -24
  86. data/tracks/rust/exercises/largest-series-product/README.md +26 -5
  87. data/tracks/rust/exercises/largest-series-product/src/lib.rs +5 -1
  88. data/tracks/rust/exercises/largest-series-product/tests/largest-series-product.rs +4 -2
  89. data/tracks/rust/exercises/leap/README.md +26 -5
  90. data/tracks/rust/exercises/luhn-from/README.md +26 -5
  91. data/tracks/rust/exercises/luhn-from/src/lib.rs +1 -0
  92. data/tracks/rust/exercises/luhn-trait/README.md +26 -5
  93. data/tracks/rust/exercises/luhn-trait/src/lib.rs +1 -0
  94. data/tracks/rust/exercises/luhn/README.md +26 -5
  95. data/tracks/rust/exercises/luhn/src/lib.rs +1 -1
  96. data/tracks/rust/exercises/macros/README.md +26 -5
  97. data/tracks/rust/exercises/minesweeper/README.md +26 -5
  98. data/tracks/rust/exercises/minesweeper/src/lib.rs +1 -0
  99. data/tracks/rust/exercises/nth-prime/README.md +26 -5
  100. data/tracks/rust/exercises/nucleotide-codons/README.md +26 -5
  101. data/tracks/rust/exercises/nucleotide-codons/src/lib.rs +1 -0
  102. data/tracks/rust/exercises/nucleotide-codons/tests/codons.rs +6 -5
  103. data/tracks/rust/exercises/nucleotide-count/README.md +26 -5
  104. data/tracks/rust/exercises/nucleotide-count/src/lib.rs +1 -0
  105. data/tracks/rust/exercises/nucleotide-count/tests/nucleotide-count.rs +5 -8
  106. data/tracks/rust/exercises/ocr-numbers/README.md +26 -5
  107. data/tracks/rust/exercises/ocr-numbers/tests/ocr-numbers.rs +0 -1
  108. data/tracks/rust/exercises/palindrome-products/README.md +26 -5
  109. data/tracks/rust/exercises/pangram/README.md +26 -5
  110. data/tracks/rust/exercises/pangram/src/lib.rs +1 -1
  111. data/tracks/rust/exercises/parallel-letter-frequency/README.md +26 -5
  112. data/tracks/rust/exercises/parallel-letter-frequency/benches/benchmark.rs +6 -3
  113. data/tracks/rust/exercises/parallel-letter-frequency/src/lib.rs +1 -0
  114. data/tracks/rust/exercises/parallel-letter-frequency/tests/parallel-letter-frequency.rs +6 -3
  115. data/tracks/rust/exercises/pascals-triangle/README.md +26 -5
  116. data/tracks/rust/exercises/pascals-triangle/tests/pascals-triangle.rs +36 -28
  117. data/tracks/rust/exercises/perfect-numbers/README.md +26 -5
  118. data/tracks/rust/exercises/perfect-numbers/src/lib.rs +1 -1
  119. data/tracks/rust/exercises/perfect-numbers/tests/perfect-numbers.rs +1 -2
  120. data/tracks/rust/exercises/phone-number/README.md +26 -5
  121. data/tracks/rust/exercises/phone-number/src/lib.rs +1 -0
  122. data/tracks/rust/exercises/pig-latin/README.md +26 -5
  123. data/tracks/rust/exercises/pig-latin/src/lib.rs +1 -0
  124. data/tracks/rust/exercises/poker/README.md +26 -5
  125. data/tracks/rust/exercises/poker/tests/poker.rs +27 -104
  126. data/tracks/rust/exercises/prime-factors/README.md +26 -5
  127. data/tracks/rust/exercises/protein-translation/README.md +26 -5
  128. data/tracks/rust/exercises/protein-translation/src/lib.rs +1 -0
  129. data/tracks/rust/exercises/protein-translation/tests/proteins.rs +16 -9
  130. data/tracks/rust/exercises/proverb/README.md +26 -5
  131. data/tracks/rust/exercises/proverb/tests/proverb.rs +1 -7
  132. data/tracks/rust/exercises/pythagorean-triplet/README.md +26 -5
  133. data/tracks/rust/exercises/queen-attack/README.md +26 -5
  134. data/tracks/rust/exercises/queen-attack/src/lib.rs +1 -0
  135. data/tracks/rust/exercises/raindrops/README.md +26 -5
  136. data/tracks/rust/exercises/raindrops/tests/raindrops.rs +57 -19
  137. data/tracks/rust/exercises/react/README.md +26 -5
  138. data/tracks/rust/exercises/react/src/lib.rs +16 -4
  139. data/tracks/rust/exercises/react/tests/react.rs +174 -43
  140. data/tracks/rust/exercises/rectangles/README.md +26 -5
  141. data/tracks/rust/exercises/rectangles/src/lib.rs +1 -0
  142. data/tracks/rust/exercises/reverse-string/README.md +26 -5
  143. data/tracks/rust/exercises/reverse-string/tests/reverse-string.rs +2 -11
  144. data/tracks/rust/exercises/rna-transcription/README.md +26 -5
  145. data/tracks/rust/exercises/rna-transcription/src/lib.rs +1 -0
  146. data/tracks/rust/exercises/robot-name/README.md +26 -5
  147. data/tracks/rust/exercises/robot-name/src/lib.rs +1 -0
  148. data/tracks/rust/exercises/robot-name/tests/robot-name.rs +8 -2
  149. data/tracks/rust/exercises/robot-simulator/README.md +26 -5
  150. data/tracks/rust/exercises/robot-simulator/src/lib.rs +5 -6
  151. data/tracks/rust/exercises/roman-numerals/README.md +26 -5
  152. data/tracks/rust/exercises/roman-numerals/src/lib.rs +1 -0
  153. data/tracks/rust/exercises/rotational-cipher/README.md +26 -5
  154. data/tracks/rust/exercises/rotational-cipher/src/lib.rs +1 -0
  155. data/tracks/rust/exercises/rotational-cipher/tests/rotational-cipher.rs +12 -4
  156. data/tracks/rust/exercises/run-length-encoding/README.md +26 -5
  157. data/tracks/rust/exercises/run-length-encoding/src/lib.rs +1 -1
  158. data/tracks/rust/exercises/run-length-encoding/tests/run-length-encoding.rs +12 -5
  159. data/tracks/rust/exercises/saddle-points/README.md +26 -5
  160. data/tracks/rust/exercises/saddle-points/src/lib.rs +4 -1
  161. data/tracks/rust/exercises/say/README.md +27 -6
  162. data/tracks/rust/exercises/say/src/lib.rs +1 -1
  163. data/tracks/rust/exercises/say/tests/say.rs +30 -14
  164. data/tracks/rust/exercises/scrabble-score/README.md +26 -5
  165. data/tracks/rust/exercises/scrabble-score/src/lib.rs +1 -1
  166. data/tracks/rust/exercises/series/README.md +32 -11
  167. data/tracks/rust/exercises/series/src/lib.rs +5 -1
  168. data/tracks/rust/exercises/sieve/README.md +31 -8
  169. data/tracks/rust/exercises/sieve/src/lib.rs +1 -0
  170. data/tracks/rust/exercises/sieve/tests/sieve.rs +11 -12
  171. data/tracks/rust/exercises/simple-cipher/README.md +26 -5
  172. data/tracks/rust/exercises/simple-cipher/src/lib.rs +6 -3
  173. data/tracks/rust/exercises/simple-cipher/tests/simple-cipher.rs +0 -1
  174. data/tracks/rust/exercises/simple-linked-list/README.md +26 -5
  175. data/tracks/rust/exercises/simple-linked-list/src/lib.rs +0 -1
  176. data/tracks/rust/exercises/simple-linked-list/tests/simple-linked-list.rs +0 -1
  177. data/tracks/rust/exercises/space-age/README.md +26 -5
  178. data/tracks/rust/exercises/space-age/tests/space-age.rs +4 -4
  179. data/tracks/rust/exercises/spiral-matrix/README.md +26 -5
  180. data/tracks/rust/exercises/sublist/README.md +26 -5
  181. data/tracks/rust/exercises/sublist/src/lib.rs +1 -0
  182. data/tracks/rust/exercises/sublist/tests/sublist.rs +17 -68
  183. data/tracks/rust/exercises/sum-of-multiples/README.md +26 -5
  184. data/tracks/rust/exercises/sum-of-multiples/src/lib.rs +5 -1
  185. data/tracks/rust/exercises/tournament/README.md +26 -5
  186. data/tracks/rust/exercises/tournament/src/lib.rs +1 -0
  187. data/tracks/rust/exercises/tournament/tests/tournament.rs +60 -60
  188. data/tracks/rust/exercises/triangle/README.md +26 -5
  189. data/tracks/rust/exercises/triangle/src/lib.rs +1 -0
  190. data/tracks/rust/exercises/two-bucket/README.md +26 -5
  191. data/tracks/rust/exercises/two-bucket/src/lib.rs +2 -6
  192. data/tracks/rust/exercises/two-bucket/tests/two-bucket.rs +49 -37
  193. data/tracks/rust/exercises/twofer/README.md +33 -7
  194. data/tracks/rust/exercises/twofer/src/lib.rs +2 -2
  195. data/tracks/rust/exercises/twofer/tests/two-fer.rs +2 -2
  196. data/tracks/rust/exercises/variable-length-quantity/README.md +26 -5
  197. data/tracks/rust/exercises/variable-length-quantity/tests/variable-length-quantity.rs +60 -32
  198. data/tracks/rust/exercises/word-count/README.md +26 -5
  199. data/tracks/rust/exercises/word-count/src/lib.rs +1 -1
  200. data/tracks/rust/exercises/word-count/tests/word-count.rs +15 -23
  201. data/tracks/rust/exercises/wordy/README.md +26 -5
  202. data/tracks/rust/exercises/wordy/src/lib.rs +1 -0
  203. metadata +3 -2
@@ -39,11 +39,31 @@ Execute the tests with:
39
39
  $ cargo test
40
40
  ```
41
41
 
42
- All but the first test have been ignored. After you get the first test to
43
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
44
- to pass again. The test file is located in the `tests` directory. You can
45
- also remove the ignore flag from all the tests to get them to run all at once
46
- if you wish.
42
+ All but the first test have been ignored. After you get the first test to
43
+ pass, open the tests source file wich is located in the `tests` directory
44
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
45
+ again. Each separate test is a function with `#[test]` flag above it.
46
+ Continue, until you pass every test.
47
+
48
+ If you wish to run all tests without editing the tests source file, use:
49
+
50
+ ```bash
51
+ $ cargo test -- --ignored
52
+ ```
53
+
54
+ To run a specific test, for example `some_test`, you can use:
55
+
56
+ ```bash
57
+ $ cargo test some_test
58
+ ```
59
+
60
+ If the specfic test is ignored use:
61
+
62
+ ```bash
63
+ $ cargo test some_test -- --ignored
64
+ ```
65
+
66
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
47
67
 
48
68
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
49
69
  haven't already, it will help you with organizing your files.
@@ -57,6 +77,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
57
77
  [help-page]: http://exercism.io/languages/rust
58
78
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
59
79
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
80
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
60
81
 
61
82
  ## Source
62
83
 
@@ -12,11 +12,15 @@ regarded as forming a rectangle when printed with intervening newlines.
12
12
 
13
13
  For example, the sentence
14
14
 
15
- > If man was meant to stay on the ground, god would have given us roots.
15
+ ```text
16
+ "If man was meant to stay on the ground, god would have given us roots."
17
+ ```
16
18
 
17
19
  is normalized to:
18
20
 
19
- > ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots
21
+ ```text
22
+ "ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots"
23
+ ```
20
24
 
21
25
  The plaintext should be organized in to a rectangle. The size of the
22
26
  rectangle (`r x c`) should be decided by the length of the message,
@@ -27,13 +31,13 @@ Our normalized text is 54 characters long, dictating a rectangle with
27
31
  `c = 8` and `r = 7`:
28
32
 
29
33
  ```text
30
- ifmanwas
31
- meanttos
32
- tayonthe
33
- groundgo
34
- dwouldha
35
- vegivenu
36
- sroots
34
+ "ifmanwas"
35
+ "meanttos"
36
+ "tayonthe"
37
+ "groundgo"
38
+ "dwouldha"
39
+ "vegivenu"
40
+ "sroots "
37
41
  ```
38
42
 
39
43
  The coded message is obtained by reading down the columns going left to
@@ -42,31 +46,30 @@ right.
42
46
  The message above is coded as:
43
47
 
44
48
  ```text
45
- imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
49
+ "imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau"
46
50
  ```
47
51
 
48
- Output the encoded text in chunks. Phrases that fill perfect rectangles
49
- `(r X c)` should be output `c` chunks of `r` length, separated by spaces.
50
- Phrases that do not fill perfect rectangles will have `n` empty spaces.
51
- Those spaces should be distributed evenly, added to the end of the last
52
- `n` chunks.
52
+ Output the encoded text in chunks that fill perfect rectangles `(r X c)`,
53
+ with `c` chunks of `r` length, separated by spaces. For phrases that are
54
+ `n` characters short of the perfect rectangle, pad each of the last `n`
55
+ chunks with a single trailing space.
53
56
 
54
57
  ```text
55
- imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
58
+ "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "
56
59
  ```
57
60
 
58
61
  Notice that were we to stack these, we could visually decode the
59
62
  cyphertext back in to the original message:
60
63
 
61
64
  ```text
62
- imtgdvs
63
- fearwer
64
- mayoogo
65
- anouuio
66
- ntnnlvt
67
- wttddes
68
- aohghn
69
- sseoau
65
+ "imtgdvs"
66
+ "fearwer"
67
+ "mayoogo"
68
+ "anouuio"
69
+ "ntnnlvt"
70
+ "wttddes"
71
+ "aohghn "
72
+ "sseoau "
70
73
  ```
71
74
 
72
75
  ## Rust Installation
@@ -82,11 +85,31 @@ Execute the tests with:
82
85
  $ cargo test
83
86
  ```
84
87
 
85
- All but the first test have been ignored. After you get the first test to
86
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
87
- to pass again. The test file is located in the `tests` directory. You can
88
- also remove the ignore flag from all the tests to get them to run all at once
89
- if you wish.
88
+ All but the first test have been ignored. After you get the first test to
89
+ pass, open the tests source file wich is located in the `tests` directory
90
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
91
+ again. Each separate test is a function with `#[test]` flag above it.
92
+ Continue, until you pass every test.
93
+
94
+ If you wish to run all tests without editing the tests source file, use:
95
+
96
+ ```bash
97
+ $ cargo test -- --ignored
98
+ ```
99
+
100
+ To run a specific test, for example `some_test`, you can use:
101
+
102
+ ```bash
103
+ $ cargo test some_test
104
+ ```
105
+
106
+ If the specfic test is ignored use:
107
+
108
+ ```bash
109
+ $ cargo test some_test -- --ignored
110
+ ```
111
+
112
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
90
113
 
91
114
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
92
115
  haven't already, it will help you with organizing your files.
@@ -100,6 +123,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
100
123
  [help-page]: http://exercism.io/languages/rust
101
124
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
102
125
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
126
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
103
127
 
104
128
  ## Source
105
129
 
@@ -20,11 +20,31 @@ Execute the tests with:
20
20
  $ cargo test
21
21
  ```
22
22
 
23
- All but the first test have been ignored. After you get the first test to
24
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
25
- to pass again. The test file is located in the `tests` directory. You can
26
- also remove the ignore flag from all the tests to get them to run all at once
27
- if you wish.
23
+ All but the first test have been ignored. After you get the first test to
24
+ pass, open the tests source file wich is located in the `tests` directory
25
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
26
+ again. Each separate test is a function with `#[test]` flag above it.
27
+ Continue, until you pass every test.
28
+
29
+ If you wish to run all tests without editing the tests source file, use:
30
+
31
+ ```bash
32
+ $ cargo test -- --ignored
33
+ ```
34
+
35
+ To run a specific test, for example `some_test`, you can use:
36
+
37
+ ```bash
38
+ $ cargo test some_test
39
+ ```
40
+
41
+ If the specfic test is ignored use:
42
+
43
+ ```bash
44
+ $ cargo test some_test -- --ignored
45
+ ```
46
+
47
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
28
48
 
29
49
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
30
50
  haven't already, it will help you with organizing your files.
@@ -38,6 +58,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
38
58
  [help-page]: http://exercism.io/languages/rust
39
59
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
40
60
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
61
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
41
62
 
42
63
  ## Submitting Incomplete Solutions
43
64
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -33,11 +33,31 @@ Execute the tests with:
33
33
  $ cargo test
34
34
  ```
35
35
 
36
- All but the first test have been ignored. After you get the first test to
37
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
38
- to pass again. The test file is located in the `tests` directory. You can
39
- also remove the ignore flag from all the tests to get them to run all at once
40
- if you wish.
36
+ All but the first test have been ignored. After you get the first test to
37
+ pass, open the tests source file wich is located in the `tests` directory
38
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
39
+ again. Each separate test is a function with `#[test]` flag above it.
40
+ Continue, until you pass every test.
41
+
42
+ If you wish to run all tests without editing the tests source file, use:
43
+
44
+ ```bash
45
+ $ cargo test -- --ignored
46
+ ```
47
+
48
+ To run a specific test, for example `some_test`, you can use:
49
+
50
+ ```bash
51
+ $ cargo test some_test
52
+ ```
53
+
54
+ If the specfic test is ignored use:
55
+
56
+ ```bash
57
+ $ cargo test some_test -- --ignored
58
+ ```
59
+
60
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
41
61
 
42
62
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
43
63
  haven't already, it will help you with organizing your files.
@@ -51,6 +71,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
51
71
  [help-page]: http://exercism.io/languages/rust
52
72
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
53
73
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
74
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
54
75
 
55
76
  ## Source
56
77
 
@@ -111,7 +111,6 @@ fn test_gt_negative_and_zero() {
111
111
  assert!(decimal("0.0") > decimal("-1.0"));
112
112
  }
113
113
 
114
-
115
114
  // tests of arbitrary precision behavior
116
115
  #[test]
117
116
  #[ignore]
@@ -130,8 +129,8 @@ fn test_eq_vary_sig_digits() {
130
129
  #[ignore]
131
130
  fn test_add_vary_precision() {
132
131
  assert_eq!(
133
- decimal("100000000000000000000000000000000000000000000") +
134
- decimal("0.00000000000000000000000000000000000000001"),
132
+ decimal("100000000000000000000000000000000000000000000")
133
+ + decimal("0.00000000000000000000000000000000000000001"),
135
134
  decimal(BIGS[0])
136
135
  )
137
136
  }
@@ -140,10 +139,8 @@ fn test_add_vary_precision() {
140
139
  #[ignore]
141
140
  fn test_cleanup_precision() {
142
141
  assert_eq!(
143
- decimal(
144
- "10000000000000000000000000000000000000000000000.999999999999999999999999998",
145
- ) +
146
- decimal(
142
+ decimal("10000000000000000000000000000000000000000000000.999999999999999999999999998",)
143
+ + decimal(
147
144
  "10000000000000000000000000000000000000000000000.000000000000000000000000002",
148
145
  ),
149
146
  decimal("20000000000000000000000000000000000000000000001")
@@ -65,11 +65,31 @@ Execute the tests with:
65
65
  $ cargo test
66
66
  ```
67
67
 
68
- All but the first test have been ignored. After you get the first test to
69
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
70
- to pass again. The test file is located in the `tests` directory. You can
71
- also remove the ignore flag from all the tests to get them to run all at once
72
- if you wish.
68
+ All but the first test have been ignored. After you get the first test to
69
+ pass, open the tests source file wich is located in the `tests` directory
70
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
71
+ again. Each separate test is a function with `#[test]` flag above it.
72
+ Continue, until you pass every test.
73
+
74
+ If you wish to run all tests without editing the tests source file, use:
75
+
76
+ ```bash
77
+ $ cargo test -- --ignored
78
+ ```
79
+
80
+ To run a specific test, for example `some_test`, you can use:
81
+
82
+ ```bash
83
+ $ cargo test some_test
84
+ ```
85
+
86
+ If the specfic test is ignored use:
87
+
88
+ ```bash
89
+ $ cargo test some_test -- --ignored
90
+ ```
91
+
92
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
73
93
 
74
94
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
75
95
  haven't already, it will help you with organizing your files.
@@ -83,6 +103,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
83
103
  [help-page]: http://exercism.io/languages/rust
84
104
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
85
105
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
106
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
86
107
 
87
108
  ## Source
88
109
 
@@ -25,11 +25,31 @@ Execute the tests with:
25
25
  $ cargo test
26
26
  ```
27
27
 
28
- All but the first test have been ignored. After you get the first test to
29
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
30
- to pass again. The test file is located in the `tests` directory. You can
31
- also remove the ignore flag from all the tests to get them to run all at once
32
- if you wish.
28
+ All but the first test have been ignored. After you get the first test to
29
+ pass, open the tests source file wich is located in the `tests` directory
30
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
31
+ again. Each separate test is a function with `#[test]` flag above it.
32
+ Continue, until you pass every test.
33
+
34
+ If you wish to run all tests without editing the tests source file, use:
35
+
36
+ ```bash
37
+ $ cargo test -- --ignored
38
+ ```
39
+
40
+ To run a specific test, for example `some_test`, you can use:
41
+
42
+ ```bash
43
+ $ cargo test some_test
44
+ ```
45
+
46
+ If the specfic test is ignored use:
47
+
48
+ ```bash
49
+ $ cargo test some_test -- --ignored
50
+ ```
51
+
52
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
33
53
 
34
54
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
35
55
  haven't already, it will help you with organizing your files.
@@ -43,6 +63,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
43
63
  [help-page]: http://exercism.io/languages/rust
44
64
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
45
65
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
66
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
46
67
 
47
68
  ## Source
48
69
 
@@ -9,6 +9,6 @@ pub fn sum_of_squares(n: usize) -> usize {
9
9
  pub fn difference(n: usize) -> usize {
10
10
  unimplemented!(
11
11
  "difference between square of sum of 1...{n} and sum of squares of 1...{n}",
12
- n=n,
12
+ n = n,
13
13
  )
14
14
  }
@@ -50,11 +50,31 @@ Execute the tests with:
50
50
  $ cargo test
51
51
  ```
52
52
 
53
- All but the first test have been ignored. After you get the first test to
54
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
55
- to pass again. The test file is located in the `tests` directory. You can
56
- also remove the ignore flag from all the tests to get them to run all at once
57
- if you wish.
53
+ All but the first test have been ignored. After you get the first test to
54
+ pass, open the tests source file wich is located in the `tests` directory
55
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
56
+ again. Each separate test is a function with `#[test]` flag above it.
57
+ Continue, until you pass every test.
58
+
59
+ If you wish to run all tests without editing the tests source file, use:
60
+
61
+ ```bash
62
+ $ cargo test -- --ignored
63
+ ```
64
+
65
+ To run a specific test, for example `some_test`, you can use:
66
+
67
+ ```bash
68
+ $ cargo test some_test
69
+ ```
70
+
71
+ If the specfic test is ignored use:
72
+
73
+ ```bash
74
+ $ cargo test some_test -- --ignored
75
+ ```
76
+
77
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
58
78
 
59
79
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
60
80
  haven't already, it will help you with organizing your files.
@@ -68,6 +88,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
68
88
  [help-page]: http://exercism.io/languages/rust
69
89
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
70
90
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
91
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
71
92
 
72
93
  ## Source
73
94
 
@@ -3,9 +3,19 @@ pub fn private_key(p: u64) -> u64 {
3
3
  }
4
4
 
5
5
  pub fn public_key(p: u64, g: u64, a: u64) -> u64 {
6
- unimplemented!("Calculate public key using prime numbers {} and {}, and private key {}", p, g, a)
6
+ unimplemented!(
7
+ "Calculate public key using prime numbers {} and {}, and private key {}",
8
+ p,
9
+ g,
10
+ a
11
+ )
7
12
  }
8
13
 
9
14
  pub fn secret(p: u64, b_pub: u64, a: u64) -> u64 {
10
- unimplemented!("Calculate secret key using prime number {}, public key {}, and private key {}", p, b_pub, a)
15
+ unimplemented!(
16
+ "Calculate secret key using prime number {}, public key {}, and private key {}",
17
+ p,
18
+ b_pub,
19
+ a
20
+ )
11
21
  }