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
@@ -31,11 +31,31 @@ Execute the tests with:
31
31
  $ cargo test
32
32
  ```
33
33
 
34
- All but the first test have been ignored. After you get the first test to
35
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
36
- to pass again. The test file is located in the `tests` directory. You can
37
- also remove the ignore flag from all the tests to get them to run all at once
38
- if you wish.
34
+ All but the first test have been ignored. After you get the first test to
35
+ pass, open the tests source file wich is located in the `tests` directory
36
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
37
+ again. Each separate test is a function with `#[test]` flag above it.
38
+ Continue, until you pass every test.
39
+
40
+ If you wish to run all tests without editing the tests source file, use:
41
+
42
+ ```bash
43
+ $ cargo test -- --ignored
44
+ ```
45
+
46
+ To run a specific test, for example `some_test`, you can use:
47
+
48
+ ```bash
49
+ $ cargo test some_test
50
+ ```
51
+
52
+ If the specfic test is ignored use:
53
+
54
+ ```bash
55
+ $ cargo test some_test -- --ignored
56
+ ```
57
+
58
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
39
59
 
40
60
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
41
61
  haven't already, it will help you with organizing your files.
@@ -49,6 +69,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
49
69
  [help-page]: http://exercism.io/languages/rust
50
70
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
51
71
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
72
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
52
73
 
53
74
  ## Source
54
75
 
@@ -5,26 +5,20 @@
5
5
  //! [script]: https://github.com/exercism/rust/blob/master/bin/init_exercise.py
6
6
  //! [canonical-data]: https://raw.githubusercontent.com/exercism/problem-specifications/master/exercises/reverse-string/canonical_data.json
7
7
 
8
-
9
8
  extern crate reverse_string;
10
9
  use reverse_string::*;
11
10
 
12
11
  /// Process a single test case for the property `reverse`
13
12
  fn process_reverse_case(input: &str, expected: &str) {
14
- assert_eq!(
15
- &reverse(input),
16
- expected
17
- )
13
+ assert_eq!(&reverse(input), expected)
18
14
  }
19
15
 
20
-
21
16
  #[test]
22
17
  /// empty string
23
18
  fn test_empty_string() {
24
19
  process_reverse_case("", "");
25
20
  }
26
21
 
27
-
28
22
  #[test]
29
23
  #[ignore]
30
24
  /// a word
@@ -32,7 +26,6 @@ fn test_a_word() {
32
26
  process_reverse_case("robot", "tobor");
33
27
  }
34
28
 
35
-
36
29
  #[test]
37
30
  #[ignore]
38
31
  /// a capitalized word
@@ -40,7 +33,6 @@ fn test_a_capitalized_word() {
40
33
  process_reverse_case("Ramen", "nemaR");
41
34
  }
42
35
 
43
-
44
36
  #[test]
45
37
  #[ignore]
46
38
  /// a sentence with punctuation
@@ -48,7 +40,6 @@ fn test_a_sentence_with_punctuation() {
48
40
  process_reverse_case("I'm hungry!", "!yrgnuh m'I");
49
41
  }
50
42
 
51
-
52
43
  #[test]
53
44
  #[ignore]
54
45
  /// a palindrome
@@ -65,7 +56,7 @@ fn test_wide_characters() {
65
56
 
66
57
  #[test]
67
58
  #[ignore]
68
- #[cfg(feature="grapheme")]
59
+ #[cfg(feature = "grapheme")]
69
60
  /// grapheme clusters
70
61
  fn test_grapheme_clusters() {
71
62
  process_reverse_case("uüu", "uüu");
@@ -42,11 +42,31 @@ Execute the tests with:
42
42
  $ cargo test
43
43
  ```
44
44
 
45
- All but the first test have been ignored. After you get the first test to
46
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
47
- to pass again. The test file is located in the `tests` directory. You can
48
- also remove the ignore flag from all the tests to get them to run all at once
49
- if you wish.
45
+ All but the first test have been ignored. After you get the first test to
46
+ pass, open the tests source file wich is located in the `tests` directory
47
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
48
+ again. Each separate test is a function with `#[test]` flag above it.
49
+ Continue, until you pass every test.
50
+
51
+ If you wish to run all tests without editing the tests source file, use:
52
+
53
+ ```bash
54
+ $ cargo test -- --ignored
55
+ ```
56
+
57
+ To run a specific test, for example `some_test`, you can use:
58
+
59
+ ```bash
60
+ $ cargo test some_test
61
+ ```
62
+
63
+ If the specfic test is ignored use:
64
+
65
+ ```bash
66
+ $ cargo test some_test -- --ignored
67
+ ```
68
+
69
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
50
70
 
51
71
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
52
72
  haven't already, it will help you with organizing your files.
@@ -60,6 +80,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
60
80
  [help-page]: http://exercism.io/languages/rust
61
81
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
62
82
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
83
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
63
84
 
64
85
  ## Source
65
86
 
@@ -28,11 +28,31 @@ Execute the tests with:
28
28
  $ cargo test
29
29
  ```
30
30
 
31
- All but the first test have been ignored. After you get the first test to
32
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
33
- to pass again. The test file is located in the `tests` directory. You can
34
- also remove the ignore flag from all the tests to get them to run all at once
35
- if you wish.
31
+ All but the first test have been ignored. After you get the first test to
32
+ pass, open the tests source file wich is located in the `tests` directory
33
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
34
+ again. Each separate test is a function with `#[test]` flag above it.
35
+ Continue, until you pass every test.
36
+
37
+ If you wish to run all tests without editing the tests source file, use:
38
+
39
+ ```bash
40
+ $ cargo test -- --ignored
41
+ ```
42
+
43
+ To run a specific test, for example `some_test`, you can use:
44
+
45
+ ```bash
46
+ $ cargo test some_test
47
+ ```
48
+
49
+ If the specfic test is ignored use:
50
+
51
+ ```bash
52
+ $ cargo test some_test -- --ignored
53
+ ```
54
+
55
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
36
56
 
37
57
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
38
58
  haven't already, it will help you with organizing your files.
@@ -46,6 +66,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
46
66
  [help-page]: http://exercism.io/languages/rust
47
67
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
48
68
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
69
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
49
70
 
50
71
  ## Source
51
72
 
@@ -12,8 +12,14 @@ impl Robot {
12
12
 
13
13
  fn assert_name_matches_pattern(n: &str) {
14
14
  assert!(n.len() == 5, "name is exactly 5 characters long");
15
- assert!(n[0..2].chars().all(|c| c >= 'A' && c <= 'Z'), "name starts with 2 uppercase letters");
16
- assert!(n[2..].chars().all(|c| c >= '0' && c <= '9'), "name ends with 3 numbers");
15
+ assert!(
16
+ n[0..2].chars().all(|c| c >= 'A' && c <= 'Z'),
17
+ "name starts with 2 uppercase letters"
18
+ );
19
+ assert!(
20
+ n[2..].chars().all(|c| c >= '0' && c <= '9'),
21
+ "name ends with 3 numbers"
22
+ );
17
23
  }
18
24
 
19
25
  fn assert_name_is_persistent(r: &robot::Robot) {
@@ -40,11 +40,31 @@ Execute the tests with:
40
40
  $ cargo test
41
41
  ```
42
42
 
43
- All but the first test have been ignored. After you get the first test to
44
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
45
- to pass again. The test file is located in the `tests` directory. You can
46
- also remove the ignore flag from all the tests to get them to run all at once
47
- if you wish.
43
+ All but the first test have been ignored. After you get the first test to
44
+ pass, open the tests source file wich is located in the `tests` directory
45
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
46
+ again. Each separate test is a function with `#[test]` flag above it.
47
+ Continue, until you pass every test.
48
+
49
+ If you wish to run all tests without editing the tests source file, use:
50
+
51
+ ```bash
52
+ $ cargo test -- --ignored
53
+ ```
54
+
55
+ To run a specific test, for example `some_test`, you can use:
56
+
57
+ ```bash
58
+ $ cargo test some_test
59
+ ```
60
+
61
+ If the specfic test is ignored use:
62
+
63
+ ```bash
64
+ $ cargo test some_test -- --ignored
65
+ ```
66
+
67
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
48
68
 
49
69
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
50
70
  haven't already, it will help you with organizing your files.
@@ -58,6 +78,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
58
78
  [help-page]: http://exercism.io/languages/rust
59
79
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
60
80
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
81
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
61
82
 
62
83
  ## Source
63
84
 
@@ -13,11 +13,7 @@ pub struct Robot;
13
13
 
14
14
  impl Robot {
15
15
  pub fn new(x: isize, y: isize, d: Direction) -> Self {
16
- unimplemented!(
17
- "Create a robot at (x, y) ({}, {}) facing {:?}",
18
- x, y,
19
- d,
20
- )
16
+ unimplemented!("Create a robot at (x, y) ({}, {}) facing {:?}", x, y, d,)
21
17
  }
22
18
 
23
19
  pub fn turn_right(self) -> Self {
@@ -33,7 +29,10 @@ impl Robot {
33
29
  }
34
30
 
35
31
  pub fn instructions(self, instructions: &str) -> Self {
36
- unimplemented!("Follow the given sequence of instructions: {}", instructions)
32
+ unimplemented!(
33
+ "Follow the given sequence of instructions: {}",
34
+ instructions
35
+ )
37
36
  }
38
37
 
39
38
  pub fn position(&self) -> (isize, isize) {
@@ -55,11 +55,31 @@ Execute the tests with:
55
55
  $ cargo test
56
56
  ```
57
57
 
58
- All but the first test have been ignored. After you get the first test to
59
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
60
- to pass again. The test file is located in the `tests` directory. You can
61
- also remove the ignore flag from all the tests to get them to run all at once
62
- if you wish.
58
+ All but the first test have been ignored. After you get the first test to
59
+ pass, open the tests source file wich is located in the `tests` directory
60
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
61
+ again. Each separate test is a function with `#[test]` flag above it.
62
+ Continue, until you pass every test.
63
+
64
+ If you wish to run all tests without editing the tests source file, use:
65
+
66
+ ```bash
67
+ $ cargo test -- --ignored
68
+ ```
69
+
70
+ To run a specific test, for example `some_test`, you can use:
71
+
72
+ ```bash
73
+ $ cargo test some_test
74
+ ```
75
+
76
+ If the specfic test is ignored use:
77
+
78
+ ```bash
79
+ $ cargo test some_test -- --ignored
80
+ ```
81
+
82
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
63
83
 
64
84
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
65
85
  haven't already, it will help you with organizing your files.
@@ -73,6 +93,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
73
93
  [help-page]: http://exercism.io/languages/rust
74
94
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
75
95
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
96
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
76
97
 
77
98
  ## Source
78
99
 
@@ -43,11 +43,31 @@ Execute the tests with:
43
43
  $ cargo test
44
44
  ```
45
45
 
46
- All but the first test have been ignored. After you get the first test to
47
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
48
- to pass again. The test file is located in the `tests` directory. You can
49
- also remove the ignore flag from all the tests to get them to run all at once
50
- if you wish.
46
+ All but the first test have been ignored. After you get the first test to
47
+ pass, open the tests source file wich is located in the `tests` directory
48
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
49
+ again. Each separate test is a function with `#[test]` flag above it.
50
+ Continue, until you pass every test.
51
+
52
+ If you wish to run all tests without editing the tests source file, use:
53
+
54
+ ```bash
55
+ $ cargo test -- --ignored
56
+ ```
57
+
58
+ To run a specific test, for example `some_test`, you can use:
59
+
60
+ ```bash
61
+ $ cargo test some_test
62
+ ```
63
+
64
+ If the specfic test is ignored use:
65
+
66
+ ```bash
67
+ $ cargo test some_test -- --ignored
68
+ ```
69
+
70
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
51
71
 
52
72
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
53
73
  haven't already, it will help you with organizing your files.
@@ -61,6 +81,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
61
81
  [help-page]: http://exercism.io/languages/rust
62
82
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
63
83
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
84
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
64
85
 
65
86
  ## Source
66
87
 
@@ -44,18 +44,26 @@ fn rotate_spaces() {
44
44
  #[test]
45
45
  #[ignore]
46
46
  fn rotate_numbers() {
47
- assert_eq!("Xiwxmrk 1 2 3 xiwxmrk", cipher::rotate("Testing 1 2 3 testing", 4));
47
+ assert_eq!(
48
+ "Xiwxmrk 1 2 3 xiwxmrk",
49
+ cipher::rotate("Testing 1 2 3 testing", 4)
50
+ );
48
51
  }
49
52
 
50
53
  #[test]
51
54
  #[ignore]
52
55
  fn rotate_punctuation() {
53
- assert_eq!("Gzo\'n zvo, Bmviyhv!", cipher::rotate("Let\'s eat, Grandma!", 21));
56
+ assert_eq!(
57
+ "Gzo\'n zvo, Bmviyhv!",
58
+ cipher::rotate("Let\'s eat, Grandma!", 21)
59
+ );
54
60
  }
55
61
 
56
62
  #[test]
57
63
  #[ignore]
58
64
  fn rotate_all_the_letters() {
59
- assert_eq!("Gur dhvpx oebja sbk whzcf bire gur ynml qbt.",
60
- cipher::rotate("The quick brown fox jumps over the lazy dog.", 13));
65
+ assert_eq!(
66
+ "Gur dhvpx oebja sbk whzcf bire gur ynml qbt.",
67
+ cipher::rotate("The quick brown fox jumps over the lazy dog.", 13)
68
+ );
61
69
  }
@@ -36,11 +36,31 @@ Execute the tests with:
36
36
  $ cargo test
37
37
  ```
38
38
 
39
- All but the first test have been ignored. After you get the first test to
40
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
41
- to pass again. The test file is located in the `tests` directory. You can
42
- also remove the ignore flag from all the tests to get them to run all at once
43
- if you wish.
39
+ All but the first test have been ignored. After you get the first test to
40
+ pass, open the tests source file wich is located in the `tests` directory
41
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
42
+ again. Each separate test is a function with `#[test]` flag above it.
43
+ Continue, until you pass every test.
44
+
45
+ If you wish to run all tests without editing the tests source file, use:
46
+
47
+ ```bash
48
+ $ cargo test -- --ignored
49
+ ```
50
+
51
+ To run a specific test, for example `some_test`, you can use:
52
+
53
+ ```bash
54
+ $ cargo test some_test
55
+ ```
56
+
57
+ If the specfic test is ignored use:
58
+
59
+ ```bash
60
+ $ cargo test some_test -- --ignored
61
+ ```
62
+
63
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
44
64
 
45
65
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
46
66
  haven't already, it will help you with organizing your files.
@@ -54,6 +74,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
54
74
  [help-page]: http://exercism.io/languages/rust
55
75
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
56
76
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
77
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
57
78
 
58
79
  ## Source
59
80