trackler 2.2.1.72 → 2.2.1.73
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/armstrong-numbers/canonical-data.json +70 -0
- data/problem-specifications/exercises/armstrong-numbers/description.md +10 -0
- data/problem-specifications/exercises/armstrong-numbers/metadata.yml +4 -0
- data/problem-specifications/exercises/bob/canonical-data.json +2 -2
- data/problem-specifications/exercises/bob/description.md +2 -0
- data/tracks/c/config.json +41 -41
- data/tracks/common-lisp/exercises/etl/README.md +1 -1
- data/tracks/common-lisp/exercises/isogram/README.md +1 -1
- data/tracks/delphi/config.json +10 -0
- data/tracks/delphi/config/maintainers.json +2 -2
- data/tracks/delphi/exercises/armstrong-numbers/ArmstrongNumbers.dpr +60 -0
- data/tracks/delphi/exercises/armstrong-numbers/README.md +39 -0
- data/tracks/delphi/exercises/armstrong-numbers/uArmstrongNumbersExample.pas +24 -0
- data/tracks/delphi/exercises/armstrong-numbers/uArmstrongNumbersTests.pas +101 -0
- data/tracks/delphi/exercises/bob/README.md +2 -0
- data/tracks/delphi/exercises/bob/uBobExample.pas +12 -3
- data/tracks/delphi/exercises/bob/uBobTests.pas +80 -23
- data/tracks/go/exercises/bob/README.md +2 -0
- data/tracks/go/exercises/bob/cases_test.go +3 -3
- data/tracks/go/exercises/bob/example.go +3 -0
- data/tracks/go/exercises/book-store/cases_test.go +7 -2
- data/tracks/go/exercises/word-count/cases_test.go +6 -1
- data/tracks/groovy/exercises/linked-list/README.md +1 -1
- data/tracks/haskell/.travis.yml +1 -0
- data/tracks/haskell/bin/ensure-readmes-are-updated.sh +40 -0
- data/tracks/haskell/config.json +9 -0
- data/tracks/haskell/exercises/rail-fence-cipher/README.md +119 -0
- data/tracks/haskell/exercises/rail-fence-cipher/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/rail-fence-cipher/examples/success-standard/src/RailFenceCipher.hs +12 -0
- data/tracks/haskell/exercises/rail-fence-cipher/package.yaml +20 -0
- data/tracks/haskell/exercises/rail-fence-cipher/src/RailFenceCipher.hs +7 -0
- data/tracks/haskell/exercises/rail-fence-cipher/stack.yaml +1 -0
- data/tracks/haskell/exercises/rail-fence-cipher/test/Tests.hs +60 -0
- data/tracks/java/CONTRIBUTING.md +14 -5
- data/tracks/java/bin/run-journey-test-from-ci.sh +1 -1
- data/tracks/java/config.json +13 -0
- data/tracks/java/exercises/custom-set/.meta/src/reference/java/CustomSet.java +12 -12
- data/tracks/java/exercises/food-chain/.meta/src/reference/java/FoodChain.java +3 -3
- data/tracks/java/exercises/grade-school/.meta/src/reference/java/School.java +7 -7
- data/tracks/java/exercises/hamming/.meta/src/reference/java/Hamming.java +3 -3
- data/tracks/java/exercises/hexadecimal/.meta/src/reference/java/Hexadecimal.java +2 -4
- data/tracks/java/exercises/isogram/.meta/src/reference/java/IsogramChecker.java +2 -2
- data/tracks/java/exercises/largest-series-product/.meta/src/reference/java/LargestSeriesProductCalculator.java +3 -3
- data/tracks/java/exercises/linked-list/.meta/src/reference/java/DoublyLinkedList.java +6 -6
- data/tracks/java/exercises/markdown/.meta/src/reference/java/Markdown.java +96 -0
- data/tracks/java/exercises/markdown/.meta/version +1 -0
- data/tracks/java/exercises/markdown/README.md +30 -0
- data/tracks/java/exercises/markdown/build.gradle +18 -0
- data/tracks/java/exercises/markdown/src/main/java/Markdown.java +83 -0
- data/tracks/java/exercises/markdown/src/test/java/MarkdownTest.java +95 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/javascript/exercises/alphametics/example.js +13 -9
- data/tracks/kotlin/docs/TESTS.md +14 -11
- data/tracks/ocaml/exercises/bob/example.ml +5 -3
- data/tracks/ocaml/exercises/bob/test.ml +3 -4
- data/tracks/ocaml/exercises/word-count/test.ml +3 -0
- data/tracks/ocaml/tools/test-generator/templates/ocaml/bob/test.ml +0 -1
- data/tracks/perl6/config.json +16 -6
- data/tracks/perl6/exercises/bob/Bob.pm6 +1 -1
- data/tracks/perl6/exercises/bob/Example.pm6 +11 -7
- data/tracks/perl6/exercises/bob/README.md +2 -0
- data/tracks/perl6/exercises/bob/bob.t +3 -3
- data/tracks/perl6/exercises/bob/example.yaml +11 -7
- data/tracks/perl6/exercises/clock/clock.t +17 -17
- data/tracks/perl6/exercises/clock/example.yaml +17 -17
- data/tracks/perl6/exercises/roman-numerals/Example.pm6 +17 -0
- data/tracks/perl6/exercises/roman-numerals/RomanNumerals.pm6 +4 -0
- data/tracks/perl6/exercises/roman-numerals/example.yaml +30 -0
- data/tracks/perl6/exercises/roman-numerals/roman-numerals.t +162 -0
- data/tracks/python/exercises/book-store/book_store_test.py +7 -1
- data/tracks/ruby/config.json +11 -0
- data/tracks/ruby/exercises/isbn-verifier/.meta/.version +1 -0
- data/tracks/ruby/exercises/isbn-verifier/.meta/generator/isbn_verifier_case.rb +28 -0
- data/tracks/ruby/exercises/isbn-verifier/.meta/solutions/isbn_verifier.rb +25 -0
- data/tracks/ruby/exercises/isbn-verifier/README.md +73 -0
- data/tracks/ruby/exercises/isbn-verifier/isbn_verifier_test.rb +105 -0
- data/tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb +3 -3
- data/tracks/ruby/exercises/isogram/isogram_test.rb +18 -18
- data/tracks/rust/README.md +0 -2
- data/tracks/rust/config.json +11 -0
- data/tracks/rust/exercises/diffie-hellman/tests/diffie-hellman.rs +0 -1
- data/tracks/rust/exercises/parallel-letter-frequency/HINTS.md +2 -2
- data/tracks/rust/exercises/parallel-letter-frequency/README.md +2 -2
- data/tracks/rust/exercises/rna-transcription/example.rs +10 -10
- data/tracks/rust/exercises/rna-transcription/tests/rna-transcription.rs +10 -10
- data/tracks/rust/exercises/series/.gitignore +3 -0
- data/tracks/rust/exercises/series/Cargo.toml +5 -0
- data/tracks/rust/exercises/series/README.md +60 -0
- data/tracks/rust/exercises/series/example.rs +13 -0
- data/tracks/rust/exercises/series/src/lib.rs +3 -0
- data/tracks/rust/exercises/series/tests/series.rs +34 -0
- data/tracks/sml/exercises/nth-prime/README.md +1 -1
- data/tracks/vimscript/.travis.yml +3 -0
- data/tracks/vimscript/docs/LEARNING.md +1 -1
- metadata +38 -2
@@ -0,0 +1,105 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require_relative 'isbn_verifier'
|
3
|
+
|
4
|
+
# Common test data version: 2.0.0 3251fa6
|
5
|
+
class IsbnVerifierTest < Minitest::Test
|
6
|
+
def test_valid_isbn_number
|
7
|
+
# skip
|
8
|
+
string = "3-598-21508-8"
|
9
|
+
assert IsbnVerifier.valid?(string), "Expected true, '#{string}' is a valid isbn"
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_invalid_isbn_check_digit
|
13
|
+
skip
|
14
|
+
string = "3-598-21508-9"
|
15
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_valid_isbn_number_with_a_check_digit_of_10
|
19
|
+
skip
|
20
|
+
string = "3-598-21507-X"
|
21
|
+
assert IsbnVerifier.valid?(string), "Expected true, '#{string}' is a valid isbn"
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_check_digit_is_a_character_other_than_x
|
25
|
+
skip
|
26
|
+
string = "3-598-21507-A"
|
27
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_invalid_character_in_isbn
|
31
|
+
skip
|
32
|
+
string = "3-598-2K507-0"
|
33
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_x_is_only_valid_as_a_check_digit
|
37
|
+
skip
|
38
|
+
string = "3-598-2X507-9"
|
39
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_valid_isbn_without_separating_dashes
|
43
|
+
skip
|
44
|
+
string = "3598215088"
|
45
|
+
assert IsbnVerifier.valid?(string), "Expected true, '#{string}' is a valid isbn"
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_isbn_without_separating_dashes_and_x_as_check_digit
|
49
|
+
skip
|
50
|
+
string = "359821507X"
|
51
|
+
assert IsbnVerifier.valid?(string), "Expected true, '#{string}' is a valid isbn"
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_isbn_without_check_digit_and_dashes
|
55
|
+
skip
|
56
|
+
string = "359821507"
|
57
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_too_long_isbn_and_no_dashes
|
61
|
+
skip
|
62
|
+
string = "3598215078X"
|
63
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
64
|
+
end
|
65
|
+
|
66
|
+
def test_isbn_without_check_digit
|
67
|
+
skip
|
68
|
+
string = "3-598-21507"
|
69
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_too_long_isbn
|
73
|
+
skip
|
74
|
+
string = "3-598-21507-XX"
|
75
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_check_digit_of_x_should_not_be_used_for_0
|
79
|
+
skip
|
80
|
+
string = "3-598-21515-X"
|
81
|
+
refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn"
|
82
|
+
end
|
83
|
+
|
84
|
+
# Problems in exercism evolve over time, as we find better ways to ask
|
85
|
+
# questions.
|
86
|
+
# The version number refers to the version of the problem you solved,
|
87
|
+
# not your solution.
|
88
|
+
#
|
89
|
+
# Define a constant named VERSION inside of the top level BookKeeping
|
90
|
+
# module, which may be placed near the end of your file.
|
91
|
+
#
|
92
|
+
# In your file, it will look like this:
|
93
|
+
#
|
94
|
+
# module BookKeeping
|
95
|
+
# VERSION = 1 # Where the version number matches the one in the test.
|
96
|
+
# end
|
97
|
+
#
|
98
|
+
# If you are curious, read more about constants on RubyDoc:
|
99
|
+
# http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
|
100
|
+
|
101
|
+
def test_bookkeeping
|
102
|
+
skip
|
103
|
+
assert_equal 1, BookKeeping::VERSION
|
104
|
+
end
|
105
|
+
end
|
@@ -5,8 +5,8 @@ class IsogramCase < Generator::ExerciseCase
|
|
5
5
|
def workload
|
6
6
|
indent_lines(
|
7
7
|
[
|
8
|
-
"
|
9
|
-
"#{assert} Isogram.isogram?(
|
8
|
+
"input = #{input.inspect}",
|
9
|
+
"#{assert} Isogram.isogram?(input), #{failure_message}"
|
10
10
|
], 4
|
11
11
|
)
|
12
12
|
end
|
@@ -18,7 +18,7 @@ class IsogramCase < Generator::ExerciseCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def reason
|
21
|
-
"'
|
21
|
+
"'\#{input}' #{is_or_not} an isogram"
|
22
22
|
end
|
23
23
|
|
24
24
|
def is_or_not
|
@@ -5,56 +5,56 @@ require_relative 'isogram'
|
|
5
5
|
class IsogramTest < Minitest::Test
|
6
6
|
def test_empty_string
|
7
7
|
# skip
|
8
|
-
|
9
|
-
assert Isogram.isogram?(
|
8
|
+
input = ""
|
9
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_isogram_with_only_lower_case_characters
|
13
13
|
skip
|
14
|
-
|
15
|
-
assert Isogram.isogram?(
|
14
|
+
input = "isogram"
|
15
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_word_with_one_duplicated_character
|
19
19
|
skip
|
20
|
-
|
21
|
-
refute Isogram.isogram?(
|
20
|
+
input = "eleven"
|
21
|
+
refute Isogram.isogram?(input), "Expected false, '#{input}' is not an isogram"
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_longest_reported_english_isogram
|
25
25
|
skip
|
26
|
-
|
27
|
-
assert Isogram.isogram?(
|
26
|
+
input = "subdermatoglyphic"
|
27
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_word_with_duplicated_character_in_mixed_case
|
31
31
|
skip
|
32
|
-
|
33
|
-
refute Isogram.isogram?(
|
32
|
+
input = "Alphabet"
|
33
|
+
refute Isogram.isogram?(input), "Expected false, '#{input}' is not an isogram"
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_hypothetical_isogrammic_word_with_hyphen
|
37
37
|
skip
|
38
|
-
|
39
|
-
assert Isogram.isogram?(
|
38
|
+
input = "thumbscrew-japingly"
|
39
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_isogram_with_duplicated_hyphen
|
43
43
|
skip
|
44
|
-
|
45
|
-
assert Isogram.isogram?(
|
44
|
+
input = "six-year-old"
|
45
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
46
46
|
end
|
47
47
|
|
48
48
|
def test_made_up_name_that_is_an_isogram
|
49
49
|
skip
|
50
|
-
|
51
|
-
assert Isogram.isogram?(
|
50
|
+
input = "Emily Jung Schwartzkopf"
|
51
|
+
assert Isogram.isogram?(input), "Expected true, '#{input}' is an isogram"
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_duplicated_character_in_the_middle
|
55
55
|
skip
|
56
|
-
|
57
|
-
refute Isogram.isogram?(
|
56
|
+
input = "accentor"
|
57
|
+
refute Isogram.isogram?(input), "Expected false, '#{input}' is not an isogram"
|
58
58
|
end
|
59
59
|
|
60
60
|
# Problems in exercism evolve over time, as we find better ways to ask
|
data/tracks/rust/README.md
CHANGED
@@ -58,8 +58,6 @@ Before submitting your pull request, you'll want to verify the changes in two wa
|
|
58
58
|
|
59
59
|
All the tests for Rust exercises can be run from the top level of the repo with `_test/check-exercises.sh`. If you are on a Windows machine, there are additional [Windows-specific instructions](_test/WINDOWS_README.md) for running this.
|
60
60
|
|
61
|
-
For the Exercism-specific linting, please see [the documentation](https://github.com/exercism/docs/blob/master/language-tracks/configuration/linting.md).
|
62
|
-
|
63
61
|
## Contributing a New Exercise
|
64
62
|
|
65
63
|
Please see the documentation about [adding new exercises](https://github.com/exercism/docs/blob/master/you-can-help/make-up-new-exercises.md).
|
data/tracks/rust/config.json
CHANGED
@@ -154,6 +154,17 @@
|
|
154
154
|
"mathematics"
|
155
155
|
]
|
156
156
|
},
|
157
|
+
{
|
158
|
+
"uuid": "9de405e1-3a05-43cb-8eb3-00b81a2968e9",
|
159
|
+
"slug": "series",
|
160
|
+
"core": false,
|
161
|
+
"unlocked_by": null,
|
162
|
+
"difficulty": 1,
|
163
|
+
"topics": [
|
164
|
+
"vectors",
|
165
|
+
"strings"
|
166
|
+
]
|
167
|
+
},
|
157
168
|
{
|
158
169
|
"uuid": "f9afd650-8103-4373-a284-fa4ecfee7207",
|
159
170
|
"slug": "collatz-conjecture",
|
@@ -24,9 +24,9 @@ If you are using rustup.rs:
|
|
24
24
|
rustup run nightly cargo bench
|
25
25
|
```
|
26
26
|
|
27
|
-
- [Benchmark tests](https://doc.rust-lang.org/book/
|
27
|
+
- [Benchmark tests](https://doc.rust-lang.org/stable/unstable-book/library-features/test.html)
|
28
28
|
|
29
29
|
Learn more about nightly Rust:
|
30
30
|
|
31
|
-
- [Nightly Rust](https://doc.rust-lang.org/book/
|
31
|
+
- [Nightly Rust](https://doc.rust-lang.org/book/first-edition/release-channels.html)
|
32
32
|
- [Rustup: Working with nightly](https://github.com/rust-lang-nursery/rustup.rs#working-with-nightly-rust)
|
@@ -33,11 +33,11 @@ If you are using rustup.rs:
|
|
33
33
|
rustup run nightly cargo bench
|
34
34
|
```
|
35
35
|
|
36
|
-
- [Benchmark tests](https://doc.rust-lang.org/book/
|
36
|
+
- [Benchmark tests](https://doc.rust-lang.org/stable/unstable-book/library-features/test.html)
|
37
37
|
|
38
38
|
Learn more about nightly Rust:
|
39
39
|
|
40
|
-
- [Nightly Rust](https://doc.rust-lang.org/book/
|
40
|
+
- [Nightly Rust](https://doc.rust-lang.org/book/first-edition/release-channels.html)
|
41
41
|
- [Rustup: Working with nightly](https://github.com/rust-lang-nursery/rustup.rs#working-with-nightly-rust)
|
42
42
|
|
43
43
|
|
@@ -1,16 +1,16 @@
|
|
1
1
|
#[derive(PartialEq, Eq, Debug)]
|
2
|
-
pub struct
|
2
|
+
pub struct RNA {
|
3
3
|
nucleotides: String
|
4
4
|
}
|
5
5
|
|
6
|
-
impl
|
7
|
-
pub fn new(nucleotides: &str) ->
|
8
|
-
|
6
|
+
impl RNA {
|
7
|
+
pub fn new(nucleotides: &str) -> RNA {
|
8
|
+
RNA { nucleotides: nucleotides.to_string() }
|
9
9
|
}
|
10
10
|
}
|
11
11
|
|
12
12
|
#[derive(PartialEq, Eq, Debug)]
|
13
|
-
pub struct
|
13
|
+
pub struct DNA {
|
14
14
|
nucleotides: String
|
15
15
|
}
|
16
16
|
|
@@ -24,15 +24,15 @@ fn transcribe_dna_rna(c: char) -> Option<char> {
|
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
27
|
-
impl
|
28
|
-
pub fn new(nucleotides: &str) ->
|
29
|
-
|
27
|
+
impl DNA {
|
28
|
+
pub fn new(nucleotides: &str) -> DNA {
|
29
|
+
DNA { nucleotides: nucleotides.to_string() }
|
30
30
|
}
|
31
31
|
|
32
|
-
pub fn to_rna(&self) -> Result<
|
32
|
+
pub fn to_rna(&self) -> Result<RNA, ()> {
|
33
33
|
let rna_nucleotides: String = self.nucleotides.chars().filter_map(transcribe_dna_rna).collect();
|
34
34
|
if rna_nucleotides.len() == self.nucleotides.len() {
|
35
|
-
Ok(
|
35
|
+
Ok(RNA { nucleotides: rna_nucleotides })
|
36
36
|
} else {
|
37
37
|
Err(())
|
38
38
|
}
|
@@ -2,54 +2,54 @@ extern crate rna_transcription as dna;
|
|
2
2
|
|
3
3
|
#[test]
|
4
4
|
fn test_acid_equals_acid() {
|
5
|
-
assert_eq!(dna::
|
6
|
-
assert_ne!(dna::
|
5
|
+
assert_eq!(dna::RNA::new("CGA"), dna::RNA::new("CGA"));
|
6
|
+
assert_ne!(dna::RNA::new("CGA"), dna::RNA::new("AGC"));
|
7
7
|
}
|
8
8
|
|
9
9
|
#[test]
|
10
10
|
#[ignore]
|
11
11
|
fn test_transcribes_cytosine_guanine() {
|
12
|
-
assert_eq!(Ok(dna::
|
12
|
+
assert_eq!(Ok(dna::RNA::new("G")), dna::DNA::new("C").to_rna());
|
13
13
|
}
|
14
14
|
|
15
15
|
#[test]
|
16
16
|
#[ignore]
|
17
17
|
fn test_transcribes_guanine_cytosine() {
|
18
|
-
assert_eq!(Ok(dna::
|
18
|
+
assert_eq!(Ok(dna::RNA::new("C")), dna::DNA::new("G").to_rna());
|
19
19
|
}
|
20
20
|
|
21
21
|
#[test]
|
22
22
|
#[ignore]
|
23
23
|
fn test_transcribes_adenine_uracil() {
|
24
|
-
assert_eq!(Ok(dna::
|
24
|
+
assert_eq!(Ok(dna::RNA::new("U")), dna::DNA::new("A").to_rna());
|
25
25
|
}
|
26
26
|
|
27
27
|
#[test]
|
28
28
|
#[ignore]
|
29
29
|
fn test_transcribes_thymine_to_adenine() {
|
30
|
-
assert_eq!(Ok(dna::
|
30
|
+
assert_eq!(Ok(dna::RNA::new("A")), dna::DNA::new("T").to_rna());
|
31
31
|
}
|
32
32
|
|
33
33
|
#[test]
|
34
34
|
#[ignore]
|
35
35
|
fn test_transcribes_all_dna_to_rna() {
|
36
|
-
assert_eq!(Ok(dna::
|
36
|
+
assert_eq!(Ok(dna::RNA::new("UGCACCAGAAUU")), dna::DNA::new("ACGTGGTCTTAA").to_rna())
|
37
37
|
}
|
38
38
|
|
39
39
|
#[test]
|
40
40
|
#[ignore]
|
41
41
|
fn handles_invalid_input() {
|
42
|
-
assert!(dna::
|
42
|
+
assert!(dna::DNA::new("U").to_rna().is_err());
|
43
43
|
}
|
44
44
|
|
45
45
|
#[test]
|
46
46
|
#[ignore]
|
47
47
|
fn handles_completely_invalid_input() {
|
48
|
-
assert!(dna::
|
48
|
+
assert!(dna::DNA::new("XXX").to_rna().is_err());
|
49
49
|
}
|
50
50
|
|
51
51
|
#[test]
|
52
52
|
#[ignore]
|
53
53
|
fn handles_partially_invalid_input() {
|
54
|
-
assert!(dna::
|
54
|
+
assert!(dna::DNA::new("ACGTXXXCTTAA").to_rna().is_err());
|
55
55
|
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Series
|
2
|
+
|
3
|
+
Given a string of digits, output all the contiguous substrings of length `n` in
|
4
|
+
that string.
|
5
|
+
|
6
|
+
For example, the string "49142" has the following 3-digit series:
|
7
|
+
|
8
|
+
- 491
|
9
|
+
- 914
|
10
|
+
- 142
|
11
|
+
|
12
|
+
And the following 4-digit series:
|
13
|
+
|
14
|
+
- 4914
|
15
|
+
- 9142
|
16
|
+
|
17
|
+
And if you ask for a 6-digit series from a 5-digit string, you deserve
|
18
|
+
whatever you get.
|
19
|
+
|
20
|
+
Note that these series are only required to occupy *adjacent positions*
|
21
|
+
in the input; the digits need not be *numerically consecutive*.
|
22
|
+
|
23
|
+
## Rust Installation
|
24
|
+
|
25
|
+
Refer to the [exercism help page][help-page] for Rust installation and learning
|
26
|
+
resources.
|
27
|
+
|
28
|
+
## Writing the Code
|
29
|
+
|
30
|
+
Execute the tests with:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
$ cargo test
|
34
|
+
```
|
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.
|
41
|
+
|
42
|
+
Make sure to read the [Modules](https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html) chapter if you
|
43
|
+
haven't already, it will help you with organizing your files.
|
44
|
+
|
45
|
+
## Feedback, Issues, Pull Requests
|
46
|
+
|
47
|
+
The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
|
48
|
+
|
49
|
+
If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
|
50
|
+
|
51
|
+
[help-page]: http://exercism.io/languages/rust
|
52
|
+
[modules]: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html
|
53
|
+
[cargo]: https://doc.rust-lang.org/book/second-edition/ch14-00-more-about-cargo.html
|
54
|
+
|
55
|
+
## Source
|
56
|
+
|
57
|
+
A subset of the Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8)
|
58
|
+
|
59
|
+
## Submitting Incomplete Solutions
|
60
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|