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
@@ -19,11 +19,31 @@ Execute the tests with:
19
19
  $ cargo test
20
20
  ```
21
21
 
22
- All but the first test have been ignored. After you get the first test to
23
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
24
- to pass again. The test file is located in the `tests` directory. You can
25
- also remove the ignore flag from all the tests to get them to run all at once
26
- if you wish.
22
+ All but the first test have been ignored. After you get the first test to
23
+ pass, open the tests source file wich is located in the `tests` directory
24
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
25
+ again. Each separate test is a function with `#[test]` flag above it.
26
+ Continue, until you pass every test.
27
+
28
+ If you wish to run all tests without editing the tests source file, use:
29
+
30
+ ```bash
31
+ $ cargo test -- --ignored
32
+ ```
33
+
34
+ To run a specific test, for example `some_test`, you can use:
35
+
36
+ ```bash
37
+ $ cargo test some_test
38
+ ```
39
+
40
+ If the specfic test is ignored use:
41
+
42
+ ```bash
43
+ $ cargo test some_test -- --ignored
44
+ ```
45
+
46
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
27
47
 
28
48
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
29
49
  haven't already, it will help you with organizing your files.
@@ -37,6 +57,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
37
57
  [help-page]: http://exercism.io/languages/rust
38
58
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
39
59
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
60
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
40
61
 
41
62
  ## Source
42
63
 
@@ -42,7 +42,14 @@ fn test_detect_anagram() {
42
42
  #[test]
43
43
  #[ignore]
44
44
  fn test_multiple_anagrams() {
45
- let inputs = ["gallery", "ballerina", "regally", "clergy", "largely", "leading"];
45
+ let inputs = [
46
+ "gallery",
47
+ "ballerina",
48
+ "regally",
49
+ "clergy",
50
+ "largely",
51
+ "leading",
52
+ ];
46
53
  let mut outputs: Vec<&str> = vec!["gallery", "regally", "largely"];
47
54
  outputs.sort();
48
55
  let mut result = anagram::anagrams_for("allergy", &inputs);
@@ -106,7 +113,11 @@ fn test_does_not_detect_a_differently_cased_unicode_word_as_its_own_anagram() {
106
113
  fn test_same_bytes_different_chars() {
107
114
  let inputs = ["€a"]; // E2 82 AC 61
108
115
  let outputs: Vec<&str> = vec![];
109
- assert_eq!(anagram::anagrams_for(
110
- "a⬂", // 61 E2 AC 82
111
- &inputs), outputs);
116
+ assert_eq!(
117
+ anagram::anagrams_for(
118
+ "a⬂", // 61 E2 AC 82
119
+ &inputs
120
+ ),
121
+ outputs
122
+ );
112
123
  }
@@ -24,11 +24,31 @@ Execute the tests with:
24
24
  $ cargo test
25
25
  ```
26
26
 
27
- All but the first test have been ignored. After you get the first test to
28
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
29
- to pass again. The test file is located in the `tests` directory. You can
30
- also remove the ignore flag from all the tests to get them to run all at once
31
- if you wish.
27
+ All but the first test have been ignored. After you get the first test to
28
+ pass, open the tests source file wich is located in the `tests` directory
29
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
30
+ again. Each separate test is a function with `#[test]` flag above it.
31
+ Continue, until you pass every test.
32
+
33
+ If you wish to run all tests without editing the tests source file, use:
34
+
35
+ ```bash
36
+ $ cargo test -- --ignored
37
+ ```
38
+
39
+ To run a specific test, for example `some_test`, you can use:
40
+
41
+ ```bash
42
+ $ cargo test some_test
43
+ ```
44
+
45
+ If the specfic test is ignored use:
46
+
47
+ ```bash
48
+ $ cargo test some_test -- --ignored
49
+ ```
50
+
51
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
32
52
 
33
53
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
34
54
  haven't already, it will help you with organizing your files.
@@ -42,6 +62,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
42
62
  [help-page]: http://exercism.io/languages/rust
43
63
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
44
64
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
65
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
45
66
 
46
67
  ## Source
47
68
 
@@ -41,11 +41,31 @@ Execute the tests with:
41
41
  $ cargo test
42
42
  ```
43
43
 
44
- All but the first test have been ignored. After you get the first test to
45
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
46
- to pass again. The test file is located in the `tests` directory. You can
47
- also remove the ignore flag from all the tests to get them to run all at once
48
- if you wish.
44
+ All but the first test have been ignored. After you get the first test to
45
+ pass, open the tests source file wich is located in the `tests` directory
46
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
47
+ again. Each separate test is a function with `#[test]` flag above it.
48
+ Continue, until you pass every test.
49
+
50
+ If you wish to run all tests without editing the tests source file, use:
51
+
52
+ ```bash
53
+ $ cargo test -- --ignored
54
+ ```
55
+
56
+ To run a specific test, for example `some_test`, you can use:
57
+
58
+ ```bash
59
+ $ cargo test some_test
60
+ ```
61
+
62
+ If the specfic test is ignored use:
63
+
64
+ ```bash
65
+ $ cargo test some_test -- --ignored
66
+ ```
67
+
68
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
49
69
 
50
70
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
51
71
  haven't already, it will help you with organizing your files.
@@ -59,6 +79,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
59
79
  [help-page]: http://exercism.io/languages/rust
60
80
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
61
81
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
82
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
62
83
 
63
84
  ## Source
64
85
 
@@ -6,4 +6,4 @@ pub fn encode(plain: &str) -> String {
6
6
  /// "Decipher" with the Atbash cipher.
7
7
  pub fn decode(cipher: &str) -> String {
8
8
  unimplemented!("Decoding of {:?} in Atbash cipher.", cipher);
9
- }
9
+ }
@@ -32,7 +32,10 @@ fn test_encode_mindblowingly() {
32
32
  #[test]
33
33
  #[ignore]
34
34
  fn test_encode_numbers() {
35
- assert_eq!("gvhgr mt123 gvhgr mt", cipher::encode("Testing,1 2 3, testing."));
35
+ assert_eq!(
36
+ "gvhgr mt123 gvhgr mt",
37
+ cipher::encode("Testing,1 2 3, testing.")
38
+ );
36
39
  }
37
40
 
38
41
  #[test]
@@ -44,8 +47,10 @@ fn test_encode_deep_thought() {
44
47
  #[test]
45
48
  #[ignore]
46
49
  fn test_encode_all_the_letters() {
47
- assert_eq!("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
48
- cipher::encode("The quick brown fox jumps over the lazy dog."));
50
+ assert_eq!(
51
+ "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
52
+ cipher::encode("The quick brown fox jumps over the lazy dog.")
53
+ );
49
54
  }
50
55
 
51
56
  #[test]
@@ -54,7 +59,6 @@ fn test_encode_ignores_non_ascii() {
54
59
  assert_eq!("mlmzh xrrrt mlivw", cipher::encode("non ascii éignored"));
55
60
  }
56
61
 
57
-
58
62
  #[test]
59
63
  #[ignore]
60
64
  fn test_decode_exercism() {
@@ -64,8 +68,10 @@ fn test_decode_exercism() {
64
68
  #[test]
65
69
  #[ignore]
66
70
  fn test_decode_a_sentence() {
67
- assert_eq!("anobstacleisoftenasteppingstone",
68
- cipher::decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v"));
71
+ assert_eq!(
72
+ "anobstacleisoftenasteppingstone",
73
+ cipher::decode("zmlyh gzxov rhlug vmzhg vkkrm thglm v")
74
+ );
69
75
  }
70
76
 
71
77
  #[test]
@@ -77,6 +83,8 @@ fn test_decode_numbers() {
77
83
  #[test]
78
84
  #[ignore]
79
85
  fn test_decode_all_the_letters() {
80
- assert_eq!("thequickbrownfoxjumpsoverthelazydog",
81
- cipher::decode("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"));
86
+ assert_eq!(
87
+ "thequickbrownfoxjumpsoverthelazydog",
88
+ cipher::decode("gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt")
89
+ );
82
90
  }
@@ -333,11 +333,31 @@ Execute the tests with:
333
333
  $ cargo test
334
334
  ```
335
335
 
336
- All but the first test have been ignored. After you get the first test to
337
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
338
- to pass again. The test file is located in the `tests` directory. You can
339
- also remove the ignore flag from all the tests to get them to run all at once
340
- if you wish.
336
+ All but the first test have been ignored. After you get the first test to
337
+ pass, open the tests source file wich is located in the `tests` directory
338
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
339
+ again. Each separate test is a function with `#[test]` flag above it.
340
+ Continue, until you pass every test.
341
+
342
+ If you wish to run all tests without editing the tests source file, use:
343
+
344
+ ```bash
345
+ $ cargo test -- --ignored
346
+ ```
347
+
348
+ To run a specific test, for example `some_test`, you can use:
349
+
350
+ ```bash
351
+ $ cargo test some_test
352
+ ```
353
+
354
+ If the specfic test is ignored use:
355
+
356
+ ```bash
357
+ $ cargo test some_test -- --ignored
358
+ ```
359
+
360
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
341
361
 
342
362
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
343
363
  haven't already, it will help you with organizing your files.
@@ -351,6 +371,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
351
371
  [help-page]: http://exercism.io/languages/rust
352
372
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
353
373
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
374
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
354
375
 
355
376
  ## Source
356
377
 
@@ -87,11 +87,31 @@ Execute the tests with:
87
87
  $ cargo test
88
88
  ```
89
89
 
90
- All but the first test have been ignored. After you get the first test to
91
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
92
- to pass again. The test file is located in the `tests` directory. You can
93
- also remove the ignore flag from all the tests to get them to run all at once
94
- if you wish.
90
+ All but the first test have been ignored. After you get the first test to
91
+ pass, open the tests source file wich is located in the `tests` directory
92
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
93
+ again. Each separate test is a function with `#[test]` flag above it.
94
+ Continue, until you pass every test.
95
+
96
+ If you wish to run all tests without editing the tests source file, use:
97
+
98
+ ```bash
99
+ $ cargo test -- --ignored
100
+ ```
101
+
102
+ To run a specific test, for example `some_test`, you can use:
103
+
104
+ ```bash
105
+ $ cargo test some_test
106
+ ```
107
+
108
+ If the specfic test is ignored use:
109
+
110
+ ```bash
111
+ $ cargo test some_test -- --ignored
112
+ ```
113
+
114
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
95
115
 
96
116
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
97
117
  haven't already, it will help you with organizing your files.
@@ -105,6 +125,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
105
125
  [help-page]: http://exercism.io/languages/rust
106
126
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
107
127
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
128
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
108
129
 
109
130
  ## Source
110
131
 
@@ -40,13 +40,19 @@ fn finds_a_value_at_the_end_of_an_array() {
40
40
  #[test]
41
41
  #[ignore]
42
42
  fn finds_a_value_in_an_array_of_odd_length() {
43
- assert_eq!(find(&[1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634], 144), Some(9));
43
+ assert_eq!(
44
+ find(&[1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634], 144),
45
+ Some(9)
46
+ );
44
47
  }
45
48
 
46
49
  #[test]
47
50
  #[ignore]
48
51
  fn finds_a_value_in_an_array_of_even_length() {
49
- assert_eq!(find(&[1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377], 21), Some(5));
52
+ assert_eq!(
53
+ find(&[1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377], 21),
54
+ Some(5)
55
+ );
50
56
  }
51
57
 
52
58
  #[test]
@@ -73,8 +79,6 @@ fn nothing_is_included_in_an_empty_array() {
73
79
  assert_eq!(find(&[], 1), None);
74
80
  }
75
81
 
76
-
77
-
78
82
  /* --------------------------------------- Optional Bonus Tests -------------------------------*/
79
83
 
80
84
  //#[test]
@@ -26,11 +26,31 @@ Execute the tests with:
26
26
  $ cargo test
27
27
  ```
28
28
 
29
- All but the first test have been ignored. After you get the first test to
30
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
31
- to pass again. The test file is located in the `tests` directory. You can
32
- also remove the ignore flag from all the tests to get them to run all at once
33
- if you wish.
29
+ All but the first test have been ignored. After you get the first test to
30
+ pass, open the tests source file wich is located in the `tests` directory
31
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
32
+ again. Each separate test is a function with `#[test]` flag above it.
33
+ Continue, until you pass every test.
34
+
35
+ If you wish to run all tests without editing the tests source file, use:
36
+
37
+ ```bash
38
+ $ cargo test -- --ignored
39
+ ```
40
+
41
+ To run a specific test, for example `some_test`, you can use:
42
+
43
+ ```bash
44
+ $ cargo test some_test
45
+ ```
46
+
47
+ If the specfic test is ignored use:
48
+
49
+ ```bash
50
+ $ cargo test some_test -- --ignored
51
+ ```
52
+
53
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
34
54
 
35
55
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
36
56
  haven't already, it will help you with organizing your files.
@@ -44,6 +64,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
44
64
  [help-page]: http://exercism.io/languages/rust
45
65
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
46
66
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
67
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
47
68
 
48
69
  ## Source
49
70
 
@@ -20,8 +20,10 @@ fn test_shouting_gibberish() {
20
20
  #[test]
21
21
  #[ignore]
22
22
  fn test_asking() {
23
- assert_eq!("Sure.",
24
- bob::reply("Does this cryogenic chamber make me look fat?"));
23
+ assert_eq!(
24
+ "Sure.",
25
+ bob::reply("Does this cryogenic chamber make me look fat?")
26
+ );
25
27
  }
26
28
 
27
29
  #[test]
@@ -45,15 +47,19 @@ fn test_exclaiming() {
45
47
  #[test]
46
48
  #[ignore]
47
49
  fn test_using_acronyms_in_regular_speech() {
48
- assert_eq!("Whatever.",
49
- bob::reply("It's OK if you don't want to go to the DMV."));
50
+ assert_eq!(
51
+ "Whatever.",
52
+ bob::reply("It's OK if you don't want to go to the DMV.")
53
+ );
50
54
  }
51
55
 
52
56
  #[test]
53
57
  #[ignore]
54
58
  fn test_forceful_question() {
55
- assert_eq!("Calm down, I know what I'm doing!",
56
- bob::reply("WHAT THE HELL WERE YOU THINKING?"));
59
+ assert_eq!(
60
+ "Calm down, I know what I'm doing!",
61
+ bob::reply("WHAT THE HELL WERE YOU THINKING?")
62
+ );
57
63
  }
58
64
 
59
65
  #[test]
@@ -77,8 +83,10 @@ fn test_question_with_only_numbers() {
77
83
  #[test]
78
84
  #[ignore]
79
85
  fn test_shouting_with_special_characters() {
80
- assert_eq!("Whoa, chill out!",
81
- bob::reply("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"));
86
+ assert_eq!(
87
+ "Whoa, chill out!",
88
+ bob::reply("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!")
89
+ );
82
90
  }
83
91
 
84
92
  #[test]
@@ -102,7 +110,10 @@ fn test_non_letters_with_question() {
102
110
  #[test]
103
111
  #[ignore]
104
112
  fn test_prattling_on() {
105
- assert_eq!("Sure.", bob::reply("Wait! Hang on. Are you going to be OK?"));
113
+ assert_eq!(
114
+ "Sure.",
115
+ bob::reply("Wait! Hang on. Are you going to be OK?")
116
+ );
106
117
  }
107
118
 
108
119
  #[test]
@@ -126,8 +137,10 @@ fn test_alternate_silence() {
126
137
  #[test]
127
138
  #[ignore]
128
139
  fn test_multiple_line_question() {
129
- assert_eq!("Whatever.", bob::reply(
130
- "\nDoes this cryogenic chamber make me look fat?\nno"));
140
+ assert_eq!(
141
+ "Whatever.",
142
+ bob::reply("\nDoes this cryogenic chamber make me look fat?\nno")
143
+ );
131
144
  }
132
145
 
133
146
  #[test]
@@ -139,8 +152,10 @@ fn test_starting_with_whitespace() {
139
152
  #[test]
140
153
  #[ignore]
141
154
  fn test_ending_with_whitespace() {
142
- assert_eq!("Sure.",
143
- bob::reply("Okay if like my spacebar quite a bit? "));
155
+ assert_eq!(
156
+ "Sure.",
157
+ bob::reply("Okay if like my spacebar quite a bit? ")
158
+ );
144
159
  }
145
160
 
146
161
  #[test]
@@ -152,6 +167,8 @@ fn test_other_whitespace() {
152
167
  #[test]
153
168
  #[ignore]
154
169
  fn test_non_question_ending_with_whitespace() {
155
- assert_eq!("Whatever.",
156
- bob::reply("This is a statement ending with whitespace "));
170
+ assert_eq!(
171
+ "Whatever.",
172
+ bob::reply("This is a statement ending with whitespace ")
173
+ );
157
174
  }