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
@@ -94,11 +94,31 @@ Execute the tests with:
94
94
  $ cargo test
95
95
  ```
96
96
 
97
- All but the first test have been ignored. After you get the first test to
98
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
99
- to pass again. The test file is located in the `tests` directory. You can
100
- also remove the ignore flag from all the tests to get them to run all at once
101
- if you wish.
97
+ All but the first test have been ignored. After you get the first test to
98
+ pass, open the tests source file wich is located in the `tests` directory
99
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
100
+ again. Each separate test is a function with `#[test]` flag above it.
101
+ Continue, until you pass every test.
102
+
103
+ If you wish to run all tests without editing the tests source file, use:
104
+
105
+ ```bash
106
+ $ cargo test -- --ignored
107
+ ```
108
+
109
+ To run a specific test, for example `some_test`, you can use:
110
+
111
+ ```bash
112
+ $ cargo test some_test
113
+ ```
114
+
115
+ If the specfic test is ignored use:
116
+
117
+ ```bash
118
+ $ cargo test some_test -- --ignored
119
+ ```
120
+
121
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
102
122
 
103
123
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
104
124
  haven't already, it will help you with organizing your files.
@@ -112,6 +132,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
112
132
  [help-page]: http://exercism.io/languages/rust
113
133
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
114
134
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
135
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
115
136
 
116
137
  ## Source
117
138
 
@@ -1,11 +1,14 @@
1
1
  pub fn encode(key: &str, s: &str) -> Option<String> {
2
- unimplemented!("Use {} to encode {} using shift cipher",key,s)
2
+ unimplemented!("Use {} to encode {} using shift cipher", key, s)
3
3
  }
4
4
 
5
5
  pub fn decode(key: &str, s: &str) -> Option<String> {
6
- unimplemented!("Use {} to decode {} using shift cipher",key,s)
6
+ unimplemented!("Use {} to decode {} using shift cipher", key, s)
7
7
  }
8
8
 
9
9
  pub fn encode_random(s: &str) -> (String, String) {
10
- unimplemented!("Generate random key with only a-z chars and encode {}. Return tuple (key, encoded s)",s)
10
+ unimplemented!(
11
+ "Generate random key with only a-z chars and encode {}. Return tuple (key, encoded s)",
12
+ s
13
+ )
11
14
  }
@@ -5,7 +5,6 @@ use std::collections::HashSet;
5
5
  const PLAIN_TEXT: &str = "thisismysecret";
6
6
  const KEY: &str = "abcdefghij";
7
7
 
8
-
9
8
  #[test]
10
9
  fn cipher_can_encode_with_given_key() {
11
10
  assert_eq!(encode(KEY, "aaaaaaaaaa"), Some(KEY.to_string()));
@@ -69,11 +69,31 @@ Execute the tests with:
69
69
  $ cargo test
70
70
  ```
71
71
 
72
- All but the first test have been ignored. After you get the first test to
73
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
74
- to pass again. The test file is located in the `tests` directory. You can
75
- also remove the ignore flag from all the tests to get them to run all at once
76
- if you wish.
72
+ All but the first test have been ignored. After you get the first test to
73
+ pass, open the tests source file wich is located in the `tests` directory
74
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
75
+ again. Each separate test is a function with `#[test]` flag above it.
76
+ Continue, until you pass every test.
77
+
78
+ If you wish to run all tests without editing the tests source file, use:
79
+
80
+ ```bash
81
+ $ cargo test -- --ignored
82
+ ```
83
+
84
+ To run a specific test, for example `some_test`, you can use:
85
+
86
+ ```bash
87
+ $ cargo test some_test
88
+ ```
89
+
90
+ If the specfic test is ignored use:
91
+
92
+ ```bash
93
+ $ cargo test some_test -- --ignored
94
+ ```
95
+
96
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
77
97
 
78
98
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
79
99
  haven't already, it will help you with organizing your files.
@@ -87,6 +107,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
87
107
  [help-page]: http://exercism.io/languages/rust
88
108
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
89
109
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
110
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
90
111
 
91
112
  ## Source
92
113
 
@@ -32,7 +32,6 @@ impl<T: Clone> SimpleLinkedList<T> {
32
32
  }
33
33
  }
34
34
 
35
-
36
35
  impl<'a, T: Clone> From<&'a [T]> for SimpleLinkedList<T> {
37
36
  fn from(_item: &[T]) -> Self {
38
37
  unimplemented!()
@@ -76,7 +76,6 @@ fn test_reverse() {
76
76
  assert_eq!(rev_list.pop(), None);
77
77
  }
78
78
 
79
-
80
79
  #[test]
81
80
  #[ignore]
82
81
  fn test_into_vector() {
@@ -38,11 +38,31 @@ Execute the tests with:
38
38
  $ cargo test
39
39
  ```
40
40
 
41
- All but the first test have been ignored. After you get the first test to
42
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
43
- to pass again. The test file is located in the `tests` directory. You can
44
- also remove the ignore flag from all the tests to get them to run all at once
45
- if you wish.
41
+ All but the first test have been ignored. After you get the first test to
42
+ pass, open the tests source file wich is located in the `tests` directory
43
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
44
+ again. Each separate test is a function with `#[test]` flag above it.
45
+ Continue, until you pass every test.
46
+
47
+ If you wish to run all tests without editing the tests source file, use:
48
+
49
+ ```bash
50
+ $ cargo test -- --ignored
51
+ ```
52
+
53
+ To run a specific test, for example `some_test`, you can use:
54
+
55
+ ```bash
56
+ $ cargo test some_test
57
+ ```
58
+
59
+ If the specfic test is ignored use:
60
+
61
+ ```bash
62
+ $ cargo test some_test -- --ignored
63
+ ```
64
+
65
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
46
66
 
47
67
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
48
68
  haven't already, it will help you with organizing your files.
@@ -56,6 +76,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
56
76
  [help-page]: http://exercism.io/languages/rust
57
77
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
58
78
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
79
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
59
80
 
60
81
  ## Source
61
82
 
@@ -6,10 +6,10 @@ fn assert_in_delta(expected: f64, actual: f64) {
6
6
  let diff: f64 = (expected - actual).abs();
7
7
  let delta: f64 = 0.01;
8
8
  if diff > delta {
9
- panic!("Your result of {} should be within {} of the expected result {}",
10
- actual,
11
- delta,
12
- expected)
9
+ panic!(
10
+ "Your result of {} should be within {} of the expected result {}",
11
+ actual, delta, expected
12
+ )
13
13
  }
14
14
  }
15
15
 
@@ -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
 
@@ -30,11 +30,31 @@ Execute the tests with:
30
30
  $ cargo test
31
31
  ```
32
32
 
33
- All but the first test have been ignored. After you get the first test to
34
- pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
35
- to pass again. The test file is located in the `tests` directory. You can
36
- also remove the ignore flag from all the tests to get them to run all at once
37
- if you wish.
33
+ All but the first test have been ignored. After you get the first test to
34
+ pass, open the tests source file wich is located in the `tests` directory
35
+ and remove the `#[ignore]` flag from the next test and get the tests to pass
36
+ again. Each separate test is a function with `#[test]` flag above it.
37
+ Continue, until you pass every test.
38
+
39
+ If you wish to run all tests without editing the tests source file, use:
40
+
41
+ ```bash
42
+ $ cargo test -- --ignored
43
+ ```
44
+
45
+ To run a specific test, for example `some_test`, you can use:
46
+
47
+ ```bash
48
+ $ cargo test some_test
49
+ ```
50
+
51
+ If the specfic test is ignored use:
52
+
53
+ ```bash
54
+ $ cargo test some_test -- --ignored
55
+ ```
56
+
57
+ To learn more about Rust tests refer to the [online test documentation][rust-tests]
38
58
 
39
59
  Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
40
60
  haven't already, it will help you with organizing your files.
@@ -48,6 +68,7 @@ If you want to know more about Exercism, take a look at the [contribution guide]
48
68
  [help-page]: http://exercism.io/languages/rust
49
69
  [modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
50
70
  [cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
71
+ [rust-tests]: https://doc.rust-lang.org/book/second-edition/ch11-02-running-tests.html
51
72
 
52
73
  ## Submitting Incomplete Solutions
53
74
  It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -6,37 +6,25 @@ use sublist::{sublist, Comparison};
6
6
  fn empty_equals_empty() {
7
7
  let v: &[u32] = &[];
8
8
 
9
- assert_eq!(
10
- Comparison::Equal,
11
- sublist(&v, &v)
12
- );
9
+ assert_eq!(Comparison::Equal, sublist(&v, &v));
13
10
  }
14
11
 
15
12
  #[test]
16
13
  #[ignore]
17
14
  fn test_empty_is_a_sublist_of_anything() {
18
- assert_eq!(
19
- Comparison::Sublist,
20
- sublist(&[], &['a', 's', 'd', 'f'])
21
- );
15
+ assert_eq!(Comparison::Sublist, sublist(&[], &['a', 's', 'd', 'f']));
22
16
  }
23
17
 
24
18
  #[test]
25
19
  #[ignore]
26
20
  fn test_anything_is_a_superlist_of_empty() {
27
- assert_eq!(
28
- Comparison::Superlist,
29
- sublist(&['a', 's', 'd', 'f'], &[])
30
- );
21
+ assert_eq!(Comparison::Superlist, sublist(&['a', 's', 'd', 'f'], &[]));
31
22
  }
32
23
 
33
24
  #[test]
34
25
  #[ignore]
35
26
  fn test_1_is_not_2() {
36
- assert_eq!(
37
- Comparison::Unequal,
38
- sublist(&[1], &[2])
39
- );
27
+ assert_eq!(Comparison::Unequal, sublist(&[1], &[2]));
40
28
  }
41
29
 
42
30
  #[test]
@@ -46,46 +34,31 @@ fn test_compare_larger_equal_lists() {
46
34
 
47
35
  let v: Vec<char> = repeat('x').take(1000).collect();
48
36
 
49
- assert_eq!(
50
- Comparison::Equal,
51
- sublist(&v, &v)
52
- );
37
+ assert_eq!(Comparison::Equal, sublist(&v, &v));
53
38
  }
54
39
 
55
40
  #[test]
56
41
  #[ignore]
57
42
  fn test_sublist_at_start() {
58
- assert_eq!(
59
- Comparison::Sublist,
60
- sublist(&[1, 2, 3], &[1, 2, 3, 4, 5])
61
- );
43
+ assert_eq!(Comparison::Sublist, sublist(&[1, 2, 3], &[1, 2, 3, 4, 5]));
62
44
  }
63
45
 
64
46
  #[test]
65
47
  #[ignore]
66
48
  fn sublist_in_middle() {
67
- assert_eq!(
68
- Comparison::Sublist,
69
- sublist(&[4, 3, 2], &[5, 4, 3, 2, 1])
70
- );
49
+ assert_eq!(Comparison::Sublist, sublist(&[4, 3, 2], &[5, 4, 3, 2, 1]));
71
50
  }
72
51
 
73
52
  #[test]
74
53
  #[ignore]
75
54
  fn sublist_at_end() {
76
- assert_eq!(
77
- Comparison::Sublist,
78
- sublist(&[3, 4, 5], &[1, 2, 3, 4, 5])
79
- );
55
+ assert_eq!(Comparison::Sublist, sublist(&[3, 4, 5], &[1, 2, 3, 4, 5]));
80
56
  }
81
57
 
82
58
  #[test]
83
59
  #[ignore]
84
60
  fn partially_matching_sublist_at_start() {
85
- assert_eq!(
86
- Comparison::Sublist,
87
- sublist(&[1, 1, 2], &[1, 1, 1, 2])
88
- );
61
+ assert_eq!(Comparison::Sublist, sublist(&[1, 1, 2], &[1, 1, 1, 2]));
89
62
  }
90
63
 
91
64
  #[test]
@@ -93,10 +66,7 @@ fn partially_matching_sublist_at_start() {
93
66
  fn sublist_early_in_huge_list() {
94
67
  let huge: Vec<u32> = (1..1000000).collect();
95
68
 
96
- assert_eq!(
97
- Comparison::Sublist,
98
- sublist(&[3, 4, 5], &huge)
99
- );
69
+ assert_eq!(Comparison::Sublist, sublist(&[3, 4, 5], &huge));
100
70
  }
101
71
 
102
72
  #[test]
@@ -105,37 +75,25 @@ fn huge_sublist_not_in_huge_list() {
105
75
  let v1: Vec<u64> = (10..1000001).collect();
106
76
  let v2: Vec<u64> = (1..1000000).collect();
107
77
 
108
- assert_eq!(
109
- Comparison::Unequal,
110
- sublist(&v1, &v2)
111
- );
78
+ assert_eq!(Comparison::Unequal, sublist(&v1, &v2));
112
79
  }
113
80
 
114
81
  #[test]
115
82
  #[ignore]
116
83
  fn superlist_at_start() {
117
- assert_eq!(
118
- Comparison::Superlist,
119
- sublist(&[1, 2, 3, 4, 5], &[1, 2, 3])
120
- );
84
+ assert_eq!(Comparison::Superlist, sublist(&[1, 2, 3, 4, 5], &[1, 2, 3]));
121
85
  }
122
86
 
123
87
  #[test]
124
88
  #[ignore]
125
89
  fn superlist_in_middle() {
126
- assert_eq!(
127
- Comparison::Superlist,
128
- sublist(&[5, 4, 3, 2, 1], &[4, 3, 2])
129
- );
90
+ assert_eq!(Comparison::Superlist, sublist(&[5, 4, 3, 2, 1], &[4, 3, 2]));
130
91
  }
131
92
 
132
93
  #[test]
133
94
  #[ignore]
134
95
  fn superlist_at_end() {
135
- assert_eq!(
136
- Comparison::Superlist,
137
- sublist(&[1, 2, 3, 4, 5], &[3, 4, 5])
138
- );
96
+ assert_eq!(Comparison::Superlist, sublist(&[1, 2, 3, 4, 5], &[3, 4, 5]));
139
97
  }
140
98
 
141
99
  #[test]
@@ -143,10 +101,7 @@ fn superlist_at_end() {
143
101
  fn superlist_early_in_huge_list() {
144
102
  let huge: Vec<u32> = (1..1000000).collect();
145
103
 
146
- assert_eq!(
147
- Comparison::Superlist,
148
- sublist(&huge, &[3, 4, 5])
149
- );
104
+ assert_eq!(Comparison::Superlist, sublist(&huge, &[3, 4, 5]));
150
105
  }
151
106
 
152
107
  #[test]
@@ -154,10 +109,7 @@ fn superlist_early_in_huge_list() {
154
109
  fn recurring_values_sublist() {
155
110
  assert_eq!(
156
111
  Comparison::Sublist,
157
- sublist(
158
- &[1, 2, 1, 2, 3],
159
- &[1, 2, 3, 1, 2, 1, 2, 3, 2, 1]
160
- )
112
+ sublist(&[1, 2, 1, 2, 3], &[1, 2, 3, 1, 2, 1, 2, 3, 2, 1])
161
113
  );
162
114
  }
163
115
 
@@ -166,9 +118,6 @@ fn recurring_values_sublist() {
166
118
  fn recurring_values_unequal() {
167
119
  assert_eq!(
168
120
  Comparison::Unequal,
169
- sublist(
170
- &[1, 2, 1, 2, 3],
171
- &[1, 2, 3, 1, 2, 3, 2, 3, 2, 1]
172
- )
121
+ sublist(&[1, 2, 1, 2, 3], &[1, 2, 3, 1, 2, 3, 2, 3, 2, 1])
173
122
  );
174
123
  }