trackler 2.2.1.128 → 2.2.1.129
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/bracket-push/canonical-data.json +9 -1
- data/tracks/bash/config.json +3 -3
- data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +3 -1
- data/tracks/crystal/exercises/difference-of-squares/spec/difference_of_squares_spec.cr +9 -9
- data/tracks/csharp/config.json +12 -0
- data/tracks/csharp/exercises/Exercises.sln +7 -1
- data/tracks/csharp/exercises/yacht/Example.cs +71 -0
- data/tracks/csharp/exercises/yacht/README.md +34 -0
- data/tracks/csharp/exercises/yacht/Yacht.cs +26 -0
- data/tracks/csharp/exercises/yacht/Yacht.csproj +18 -0
- data/tracks/csharp/exercises/yacht/YachtTest.cs +162 -0
- data/tracks/csharp/generators/Exercises/Yacht.cs +20 -0
- data/tracks/dart/exercises/leap/lib/example.dart +4 -8
- data/tracks/dart/exercises/leap/lib/leap.dart +1 -1
- data/tracks/dart/exercises/leap/test/leap_test.dart +14 -16
- data/tracks/delphi/config.json +11 -0
- data/tracks/delphi/exercises/bracket-push/BracketPush.dpr +60 -0
- data/tracks/delphi/exercises/bracket-push/README.md +31 -0
- data/tracks/delphi/exercises/bracket-push/uBracketPushExample.pas +40 -0
- data/tracks/delphi/exercises/bracket-push/uBracketPushTest.pas +158 -0
- data/tracks/fsharp/config.json +18 -6
- data/tracks/fsharp/exercises/Exercises.sln +7 -1
- data/tracks/fsharp/exercises/accumulate/Accumulate.fsproj +2 -2
- data/tracks/fsharp/exercises/acronym/Acronym.fsproj +2 -2
- data/tracks/fsharp/exercises/all-your-base/AllYourBase.fsproj +2 -2
- data/tracks/fsharp/exercises/allergies/Allergies.fsproj +2 -2
- data/tracks/fsharp/exercises/alphametics/Alphametics.fsproj +2 -2
- data/tracks/fsharp/exercises/anagram/Anagram.fsproj +2 -2
- data/tracks/fsharp/exercises/armstrong-numbers/ArmstrongNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/bank-account/BankAccount.fsproj +2 -2
- data/tracks/fsharp/exercises/beer-song/BeerSong.fsproj +2 -2
- data/tracks/fsharp/exercises/binary/Binary.fsproj +2 -2
- data/tracks/fsharp/exercises/binary-search/BinarySearch.fsproj +2 -2
- data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTree.fsproj +2 -2
- data/tracks/fsharp/exercises/bob/Bob.fsproj +2 -2
- data/tracks/fsharp/exercises/book-store/BookStore.fsproj +2 -2
- data/tracks/fsharp/exercises/bowling/Bowling.fsproj +2 -2
- data/tracks/fsharp/exercises/bowling/BowlingTest.fs +15 -1
- data/tracks/fsharp/exercises/bracket-push/BracketPush.fsproj +2 -2
- data/tracks/fsharp/exercises/change/Change.fsproj +2 -2
- data/tracks/fsharp/exercises/circular-buffer/CircularBuffer.fsproj +2 -2
- data/tracks/fsharp/exercises/circular-buffer/CircularBufferTest.fs +1 -1
- data/tracks/fsharp/exercises/clock/Clock.fsproj +2 -2
- data/tracks/fsharp/exercises/collatz-conjecture/CollatzConjecture.fsproj +2 -2
- data/tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/connect/Connect.fsproj +2 -2
- data/tracks/fsharp/exercises/crypto-square/CryptoSquare.fsproj +2 -2
- data/tracks/fsharp/exercises/custom-set/CustomSet.fsproj +2 -2
- data/tracks/fsharp/exercises/diamond/Diamond.fsproj +2 -2
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquares.fsproj +2 -2
- data/tracks/fsharp/exercises/diffie-hellman/DiffieHellman.fsproj +2 -2
- data/tracks/fsharp/exercises/dominoes/Dominoes.fsproj +2 -2
- data/tracks/fsharp/exercises/dot-dsl/DotDsl.fsproj +2 -2
- data/tracks/fsharp/exercises/error-handling/ErrorHandling.fsproj +2 -2
- data/tracks/fsharp/exercises/etl/Etl.fsproj +2 -2
- data/tracks/fsharp/exercises/food-chain/FoodChain.fsproj +2 -2
- data/tracks/fsharp/exercises/forth/Forth.fsproj +2 -2
- data/tracks/fsharp/exercises/forth/ForthTest.fs +1 -1
- data/tracks/fsharp/exercises/gigasecond/Gigasecond.fsproj +2 -2
- data/tracks/fsharp/exercises/go-counting/GoCounting.fsproj +2 -2
- data/tracks/fsharp/exercises/grade-school/GradeSchool.fsproj +2 -2
- data/tracks/fsharp/exercises/grains/Grains.fsproj +2 -2
- data/tracks/fsharp/exercises/grains/GrainsTest.fs +1 -1
- data/tracks/fsharp/exercises/grep/Grep.fsproj +2 -2
- data/tracks/fsharp/exercises/grep/GrepTest.fs +1 -1
- data/tracks/fsharp/exercises/hamming/Hamming.fsproj +2 -2
- data/tracks/fsharp/exercises/hangman/Hangman.fsproj +2 -2
- data/tracks/fsharp/exercises/hello-world/HelloWorld.fsproj +2 -2
- data/tracks/fsharp/exercises/hexadecimal/Hexadecimal.fsproj +2 -2
- data/tracks/fsharp/exercises/house/Example.fs +2 -2
- data/tracks/fsharp/exercises/house/House.fsproj +2 -2
- data/tracks/fsharp/exercises/house/HouseTest.fs +28 -211
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifier.fsproj +2 -2
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +2 -2
- data/tracks/fsharp/exercises/isogram/Isogram.fsproj +2 -2
- data/tracks/fsharp/exercises/isogram/IsogramTest.fs +1 -1
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fsproj +2 -2
- data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fsproj +2 -2
- data/tracks/fsharp/exercises/leap/Leap.fsproj +2 -2
- data/tracks/fsharp/exercises/ledger/Ledger.fsproj +2 -2
- data/tracks/fsharp/exercises/lens-person/LensPerson.fsproj +2 -2
- data/tracks/fsharp/exercises/linked-list/LinkedList.fsproj +2 -2
- data/tracks/fsharp/exercises/list-ops/ListOps.fsproj +2 -2
- data/tracks/fsharp/exercises/list-ops/ListOpsTest.fs +1 -1
- data/tracks/fsharp/exercises/luhn/Luhn.fsproj +2 -2
- data/tracks/fsharp/exercises/markdown/Markdown.fsproj +2 -2
- data/tracks/fsharp/exercises/matrix/Matrix.fsproj +2 -2
- data/tracks/fsharp/exercises/meetup/Meetup.fsproj +2 -2
- data/tracks/fsharp/exercises/minesweeper/Minesweeper.fsproj +2 -2
- data/tracks/fsharp/exercises/nth-prime/NthPrime.fsproj +2 -2
- data/tracks/fsharp/exercises/nucleotide-count/NucleotideCount.fsproj +2 -2
- data/tracks/fsharp/exercises/ocr-numbers/OcrNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/octal/Octal.fsproj +2 -2
- data/tracks/fsharp/exercises/palindrome-products/PalindromeProducts.fsproj +2 -2
- data/tracks/fsharp/exercises/pangram/Pangram.fsproj +2 -2
- data/tracks/fsharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.fsproj +2 -2
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fsproj +2 -2
- data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/phone-number/PhoneNumber.fsproj +2 -2
- data/tracks/fsharp/exercises/pig-latin/PigLatin.fsproj +2 -2
- data/tracks/fsharp/exercises/poker/Poker.fsproj +2 -2
- data/tracks/fsharp/exercises/pov/Pov.fsproj +2 -2
- data/tracks/fsharp/exercises/pov/PovTest.fs +2 -2
- data/tracks/fsharp/exercises/prime-factors/PrimeFactors.fsproj +2 -2
- data/tracks/fsharp/exercises/protein-translation/ProteinTranslation.fsproj +2 -2
- data/tracks/fsharp/exercises/proverb/Proverb.fsproj +2 -2
- data/tracks/fsharp/exercises/pythagorean-triplet/PythagoreanTriplet.fsproj +2 -2
- data/tracks/fsharp/exercises/queen-attack/QueenAttack.fsproj +2 -2
- data/tracks/fsharp/exercises/rail-fence-cipher/RailFenceCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/raindrops/Raindrops.fsproj +2 -2
- data/tracks/fsharp/exercises/rational-numbers/RationalNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/react/Example.fs +1 -1
- data/tracks/fsharp/exercises/react/React.fsproj +2 -2
- data/tracks/fsharp/exercises/react/ReactTest.fs +14 -1
- data/tracks/fsharp/exercises/rectangles/Rectangles.fsproj +2 -2
- data/tracks/fsharp/exercises/reverse-string/ReverseString.fsproj +2 -2
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fsproj +2 -2
- data/tracks/fsharp/exercises/robot-name/RobotName.fsproj +2 -2
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fsproj +2 -2
- data/tracks/fsharp/exercises/roman-numerals/RomanNumerals.fsproj +2 -2
- data/tracks/fsharp/exercises/rotational-cipher/RotationalCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncoding.fsproj +2 -2
- data/tracks/fsharp/exercises/saddle-points/SaddlePoints.fsproj +2 -2
- data/tracks/fsharp/exercises/say/Say.fsproj +2 -2
- data/tracks/fsharp/exercises/scale-generator/ScaleGenerator.fsproj +2 -2
- data/tracks/fsharp/exercises/scrabble-score/ScrabbleScore.fsproj +2 -2
- data/tracks/fsharp/exercises/secret-handshake/SecretHandshake.fsproj +2 -2
- data/tracks/fsharp/exercises/series/Series.fsproj +2 -2
- data/tracks/fsharp/exercises/sgf-parsing/SgfParsing.fsproj +2 -2
- data/tracks/fsharp/exercises/sieve/Sieve.fsproj +2 -2
- data/tracks/fsharp/exercises/simple-cipher/SimpleCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/simple-linked-list/SimpleLinkedList.fsproj +2 -2
- data/tracks/fsharp/exercises/space-age/SpaceAge.fsproj +2 -2
- data/tracks/fsharp/exercises/spiral-matrix/SpiralMatrix.fsproj +2 -2
- data/tracks/fsharp/exercises/strain/Strain.fsproj +2 -2
- data/tracks/fsharp/exercises/sublist/Sublist.fsproj +2 -2
- data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiples.fsproj +2 -2
- data/tracks/fsharp/exercises/tournament/Tournament.fsproj +2 -2
- data/tracks/fsharp/exercises/transpose/Transpose.fsproj +2 -2
- data/tracks/fsharp/exercises/tree-building/TreeBuilding.fsproj +2 -2
- data/tracks/fsharp/exercises/triangle/Triangle.fsproj +2 -2
- data/tracks/fsharp/exercises/trinary/Trinary.fsproj +2 -2
- data/tracks/fsharp/exercises/twelve-days/TwelveDays.fsproj +2 -2
- data/tracks/fsharp/exercises/two-bucket/TwoBucket.fsproj +2 -2
- data/tracks/fsharp/exercises/two-fer/TwoFer.fsproj +2 -2
- data/tracks/fsharp/exercises/variable-length-quantity/VariableLengthQuantity.fsproj +2 -2
- data/tracks/fsharp/exercises/word-count/WordCount.fsproj +2 -2
- data/tracks/fsharp/exercises/word-search/WordSearch.fsproj +2 -2
- data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +1 -1
- data/tracks/fsharp/exercises/wordy/Wordy.fsproj +2 -2
- data/tracks/fsharp/exercises/yacht/Example.fs +65 -0
- data/tracks/fsharp/exercises/yacht/Program.fs +1 -0
- data/tracks/fsharp/exercises/yacht/README.md +34 -0
- data/tracks/fsharp/exercises/yacht/Yacht.fs +17 -0
- data/tracks/fsharp/exercises/yacht/Yacht.fsproj +23 -0
- data/tracks/fsharp/exercises/yacht/YachtTest.fs +113 -0
- data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzle.fsproj +2 -2
- data/tracks/fsharp/exercises/zipper/Zipper.fsproj +2 -2
- data/tracks/fsharp/generators/CanonicalData.fs +2 -20
- data/tracks/fsharp/generators/Common.fs +1 -1
- data/tracks/fsharp/generators/Generators.fs +24 -11
- data/tracks/fsharp/generators/Generators.fsproj +4 -4
- data/tracks/fsharp/generators/Options.fs +1 -1
- data/tracks/haskell/exercises/bracket-push/package.yaml +1 -1
- data/tracks/haskell/exercises/bracket-push/test/Tests.hs +4 -0
- data/tracks/java/config.json +13 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/ChainNotFoundException.java +5 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/Domino.java +30 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/Dominoes.java +67 -0
- data/tracks/java/exercises/dominoes/.meta/version +2 -0
- data/tracks/java/exercises/dominoes/README.md +29 -0
- data/tracks/java/exercises/dominoes/build.gradle +18 -0
- data/tracks/java/exercises/dominoes/src/main/java/ChainNotFoundException.java +5 -0
- data/tracks/java/exercises/dominoes/src/main/java/Domino.java +30 -0
- data/tracks/java/exercises/dominoes/src/test/java/DominoesTest.java +230 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/javascript/.eslintignore +0 -1
- data/tracks/javascript/exercises/simple-cipher/example.js +4 -6
- data/tracks/javascript/exercises/simple-cipher/simple-cipher.spec.js +7 -3
- data/tracks/php/config.json +7 -7
- data/tracks/python/config.json +195 -188
- data/tracks/python/exercises/alphametics/alphametics_test.py +1 -0
- data/tracks/python/exercises/bank-account/README.md +20 -1
- data/tracks/python/exercises/go-counting/README.md +2 -0
- data/tracks/python/test/check-exercises.py +1 -1
- data/tracks/rust/_test/ensure-stubs-compile.sh +5 -0
- data/tracks/rust/config/exercise_readme.go.tmpl +1 -1
- data/tracks/rust/config.json +10 -0
- data/tracks/rust/exercises/accumulate/README.md +1 -1
- data/tracks/rust/exercises/acronym/README.md +1 -1
- data/tracks/rust/exercises/all-your-base/README.md +1 -1
- data/tracks/rust/exercises/all-your-base/example.rs +15 -5
- data/tracks/rust/exercises/all-your-base/src/lib.rs +8 -1
- data/tracks/rust/exercises/all-your-base/tests/all-your-base.rs +10 -5
- data/tracks/rust/exercises/allergies/README.md +1 -1
- data/tracks/rust/exercises/alphametics/README.md +1 -1
- data/tracks/rust/exercises/anagram/README.md +1 -1
- data/tracks/rust/exercises/armstrong-numbers/.gitignore +3 -0
- data/tracks/rust/exercises/armstrong-numbers/Cargo.toml +3 -0
- data/tracks/rust/exercises/armstrong-numbers/README.md +51 -0
- data/tracks/rust/exercises/armstrong-numbers/example.rs +7 -0
- data/tracks/rust/exercises/armstrong-numbers/src/lib.rs +3 -0
- data/tracks/rust/exercises/armstrong-numbers/tests/armstrong-numbers.rs +49 -0
- data/tracks/rust/exercises/atbash-cipher/README.md +1 -1
- data/tracks/rust/exercises/beer-song/README.md +1 -1
- data/tracks/rust/exercises/binary-search/README.md +1 -1
- data/tracks/rust/exercises/bob/README.md +1 -1
- data/tracks/rust/exercises/book-store/README.md +1 -1
- data/tracks/rust/exercises/bowling/README.md +1 -1
- data/tracks/rust/exercises/bowling/example.rs +13 -8
- data/tracks/rust/exercises/bowling/src/lib.rs +22 -0
- data/tracks/rust/exercises/bowling/tests/bowling.rs +31 -31
- data/tracks/rust/exercises/bracket-push/README.md +1 -1
- data/tracks/rust/exercises/circular-buffer/README.md +1 -1
- data/tracks/rust/exercises/clock/README.md +1 -1
- data/tracks/rust/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/rust/exercises/crypto-square/README.md +1 -1
- data/tracks/rust/exercises/crypto-square/example.rs +11 -3
- data/tracks/rust/exercises/crypto-square/tests/crypto-square.rs +8 -16
- data/tracks/rust/exercises/custom-set/README.md +1 -1
- data/tracks/rust/exercises/custom-set/example.rs +17 -17
- data/tracks/rust/exercises/custom-set/tests/custom-set.rs +84 -84
- data/tracks/rust/exercises/decimal/README.md +1 -1
- data/tracks/rust/exercises/difference-of-squares/README.md +1 -1
- data/tracks/rust/exercises/diffie-hellman/README.md +1 -1
- data/tracks/rust/exercises/dominoes/README.md +1 -1
- data/tracks/rust/exercises/etl/README.md +1 -1
- data/tracks/rust/exercises/forth/README.md +1 -1
- data/tracks/rust/exercises/gigasecond/README.md +1 -1
- data/tracks/rust/exercises/grade-school/README.md +1 -1
- data/tracks/rust/exercises/grains/README.md +1 -1
- data/tracks/rust/exercises/hamming/README.md +1 -1
- data/tracks/rust/exercises/hello-world/README.md +1 -1
- data/tracks/rust/exercises/hexadecimal/README.md +1 -1
- data/tracks/rust/exercises/isbn-verifier/README.md +1 -1
- data/tracks/rust/exercises/isogram/README.md +1 -1
- data/tracks/rust/exercises/largest-series-product/README.md +1 -1
- data/tracks/rust/exercises/largest-series-product/example.rs +10 -4
- data/tracks/rust/exercises/largest-series-product/src/lib.rs +9 -0
- data/tracks/rust/exercises/largest-series-product/tests/largest-series-product.rs +3 -3
- data/tracks/rust/exercises/leap/README.md +1 -1
- data/tracks/rust/exercises/luhn/README.md +1 -1
- data/tracks/rust/exercises/luhn-from/README.md +1 -1
- data/tracks/rust/exercises/luhn-trait/README.md +1 -1
- data/tracks/rust/exercises/macros/.meta/ALLOWED_TO_NOT_COMPILE +2 -0
- data/tracks/rust/exercises/macros/README.md +1 -1
- data/tracks/rust/exercises/minesweeper/README.md +1 -1
- data/tracks/rust/exercises/nth-prime/README.md +1 -1
- data/tracks/rust/exercises/nucleotide-codons/README.md +1 -1
- data/tracks/rust/exercises/nucleotide-count/README.md +1 -1
- data/tracks/rust/exercises/ocr-numbers/README.md +1 -1
- data/tracks/rust/exercises/ocr-numbers/example.rs +14 -6
- data/tracks/rust/exercises/ocr-numbers/src/lib.rs +7 -1
- data/tracks/rust/exercises/ocr-numbers/tests/ocr-numbers.rs +2 -2
- data/tracks/rust/exercises/pangram/README.md +1 -1
- data/tracks/rust/exercises/parallel-letter-frequency/README.md +1 -1
- data/tracks/rust/exercises/pascals-triangle/README.md +1 -1
- data/tracks/rust/exercises/perfect-numbers/README.md +1 -1
- data/tracks/rust/exercises/phone-number/README.md +1 -1
- data/tracks/rust/exercises/pig-latin/README.md +1 -1
- data/tracks/rust/exercises/poker/README.md +1 -1
- data/tracks/rust/exercises/prime-factors/README.md +1 -1
- data/tracks/rust/exercises/protein-translation/README.md +1 -1
- data/tracks/rust/exercises/proverb/README.md +1 -1
- data/tracks/rust/exercises/pythagorean-triplet/README.md +1 -1
- data/tracks/rust/exercises/queen-attack/README.md +1 -1
- data/tracks/rust/exercises/raindrops/README.md +1 -1
- data/tracks/rust/exercises/react/README.md +1 -1
- data/tracks/rust/exercises/react/example.rs +27 -18
- data/tracks/rust/exercises/react/src/lib.rs +25 -10
- data/tracks/rust/exercises/react/tests/react.rs +113 -83
- data/tracks/rust/exercises/rectangles/README.md +1 -1
- data/tracks/rust/exercises/reverse-string/README.md +1 -1
- data/tracks/rust/exercises/rna-transcription/README.md +1 -1
- data/tracks/rust/exercises/robot-name/README.md +1 -1
- data/tracks/rust/exercises/robot-simulator/README.md +1 -1
- data/tracks/rust/exercises/roman-numerals/README.md +1 -1
- data/tracks/rust/exercises/rotational-cipher/README.md +1 -1
- data/tracks/rust/exercises/run-length-encoding/README.md +1 -1
- data/tracks/rust/exercises/saddle-points/README.md +1 -1
- data/tracks/rust/exercises/say/README.md +1 -1
- data/tracks/rust/exercises/scrabble-score/README.md +1 -1
- data/tracks/rust/exercises/series/README.md +1 -1
- data/tracks/rust/exercises/sieve/README.md +1 -1
- data/tracks/rust/exercises/simple-linked-list/README.md +1 -1
- data/tracks/rust/exercises/space-age/README.md +1 -1
- data/tracks/rust/exercises/sublist/README.md +1 -1
- data/tracks/rust/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/rust/exercises/tournament/README.md +1 -1
- data/tracks/rust/exercises/triangle/README.md +1 -1
- data/tracks/rust/exercises/two-bucket/README.md +1 -1
- data/tracks/rust/exercises/variable-length-quantity/README.md +1 -1
- data/tracks/rust/exercises/word-count/README.md +1 -1
- data/tracks/rust/exercises/wordy/README.md +1 -1
- data/tracks/typescript/config.json +11 -0
- data/tracks/typescript/exercises/list-ops/README.md +35 -0
- data/tracks/typescript/exercises/list-ops/list-ops.example.ts +80 -0
- data/tracks/typescript/exercises/list-ops/list-ops.test.ts +117 -0
- data/tracks/typescript/exercises/list-ops/list-ops.ts +0 -0
- data/tracks/typescript/exercises/list-ops/package.json +36 -0
- data/tracks/typescript/exercises/list-ops/tsconfig.json +22 -0
- data/tracks/typescript/exercises/list-ops/tslint.json +127 -0
- data/tracks/typescript/exercises/list-ops/yarn.lock +2624 -0
- metadata +42 -3
- data/tracks/dart/exercises/leap/pubspec.lock +0 -293
@@ -4,43 +4,43 @@ use set::*;
|
|
4
4
|
|
5
5
|
#[test]
|
6
6
|
fn sets_with_no_elements_are_empty() {
|
7
|
-
let set: CustomSet<()> = CustomSet::new(
|
7
|
+
let set: CustomSet<()> = CustomSet::new(&[]);
|
8
8
|
assert!(set.is_empty());
|
9
9
|
}
|
10
10
|
|
11
11
|
#[test]
|
12
12
|
#[ignore]
|
13
13
|
fn sets_with_elements_are_not_empty() {
|
14
|
-
let set = CustomSet::new(
|
14
|
+
let set = CustomSet::new(&[1]);
|
15
15
|
assert!(!set.is_empty());
|
16
16
|
}
|
17
17
|
|
18
18
|
#[test]
|
19
19
|
#[ignore]
|
20
20
|
fn nothing_is_contained_in_an_empty_set() {
|
21
|
-
let set = CustomSet::new(
|
21
|
+
let set = CustomSet::new(&[]);
|
22
22
|
assert!(!set.contains(&1));
|
23
23
|
}
|
24
24
|
|
25
25
|
#[test]
|
26
26
|
#[ignore]
|
27
27
|
fn true_when_the_element_is_in_the_set() {
|
28
|
-
let set = CustomSet::new(
|
28
|
+
let set = CustomSet::new(&[1, 2, 3]);
|
29
29
|
assert!(set.contains(&1));
|
30
30
|
}
|
31
31
|
|
32
32
|
#[test]
|
33
33
|
#[ignore]
|
34
34
|
fn false_when_the_element_is_not_in_the_set() {
|
35
|
-
let set = CustomSet::new(
|
35
|
+
let set = CustomSet::new(&[1, 2, 3]);
|
36
36
|
assert!(!set.contains(&4));
|
37
37
|
}
|
38
38
|
|
39
39
|
#[test]
|
40
40
|
#[ignore]
|
41
41
|
fn empty_sets_are_subsets_of_each_other() {
|
42
|
-
let set1: CustomSet<()> = CustomSet::new(
|
43
|
-
let set2: CustomSet<()> = CustomSet::new(
|
42
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
43
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
44
44
|
assert!(set1.is_subset(&set2));
|
45
45
|
assert!(set2.is_subset(&set1));
|
46
46
|
}
|
@@ -48,24 +48,24 @@ fn empty_sets_are_subsets_of_each_other() {
|
|
48
48
|
#[test]
|
49
49
|
#[ignore]
|
50
50
|
fn empty_set_is_subset_of_non_empty_set() {
|
51
|
-
let set1 = CustomSet::new(
|
52
|
-
let set2 = CustomSet::new(
|
51
|
+
let set1 = CustomSet::new(&[]);
|
52
|
+
let set2 = CustomSet::new(&[1]);
|
53
53
|
assert!(set1.is_subset(&set2));
|
54
54
|
}
|
55
55
|
|
56
56
|
#[test]
|
57
57
|
#[ignore]
|
58
58
|
fn non_empty_set_is_not_subset_of_empty_set() {
|
59
|
-
let set1 = CustomSet::new(
|
60
|
-
let set2 = CustomSet::new(
|
59
|
+
let set1 = CustomSet::new(&[1]);
|
60
|
+
let set2 = CustomSet::new(&[]);
|
61
61
|
assert!(!set1.is_subset(&set2));
|
62
62
|
}
|
63
63
|
|
64
64
|
#[test]
|
65
65
|
#[ignore]
|
66
66
|
fn sets_with_same_elements_are_subsets() {
|
67
|
-
let set1 = CustomSet::new(
|
68
|
-
let set2 = CustomSet::new(
|
67
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
68
|
+
let set2 = CustomSet::new(&[1, 2, 3]);
|
69
69
|
assert!(set1.is_subset(&set2));
|
70
70
|
assert!(set2.is_subset(&set1));
|
71
71
|
}
|
@@ -73,24 +73,24 @@ fn sets_with_same_elements_are_subsets() {
|
|
73
73
|
#[test]
|
74
74
|
#[ignore]
|
75
75
|
fn set_contained_in_other_set_is_a_subset() {
|
76
|
-
let set1 = CustomSet::new(
|
77
|
-
let set2 = CustomSet::new(
|
76
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
77
|
+
let set2 = CustomSet::new(&[4, 1, 2, 3]);
|
78
78
|
assert!(set1.is_subset(&set2));
|
79
79
|
}
|
80
80
|
|
81
81
|
#[test]
|
82
82
|
#[ignore]
|
83
83
|
fn set_not_contained_in_other_set_is_not_a_subset_one() {
|
84
|
-
let set1 = CustomSet::new(
|
85
|
-
let set2 = CustomSet::new(
|
84
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
85
|
+
let set2 = CustomSet::new(&[4, 1, 3]);
|
86
86
|
assert!(!set1.is_subset(&set2));
|
87
87
|
}
|
88
88
|
|
89
89
|
#[test]
|
90
90
|
#[ignore]
|
91
91
|
fn empty_sets_are_disjoint_with_each_other() {
|
92
|
-
let set1: CustomSet<()> = CustomSet::new(
|
93
|
-
let set2: CustomSet<()> = CustomSet::new(
|
92
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
93
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
94
94
|
assert!(set1.is_disjoint(&set2));
|
95
95
|
assert!(set2.is_disjoint(&set1));
|
96
96
|
}
|
@@ -98,24 +98,24 @@ fn empty_sets_are_disjoint_with_each_other() {
|
|
98
98
|
#[test]
|
99
99
|
#[ignore]
|
100
100
|
fn empty_set_disjoint_with_non_empty_set() {
|
101
|
-
let set1 = CustomSet::new(
|
102
|
-
let set2 = CustomSet::new(
|
101
|
+
let set1 = CustomSet::new(&[]);
|
102
|
+
let set2 = CustomSet::new(&[1]);
|
103
103
|
assert!(set1.is_disjoint(&set2));
|
104
104
|
}
|
105
105
|
|
106
106
|
#[test]
|
107
107
|
#[ignore]
|
108
108
|
fn non_empty_set_disjoint_with_empty_set() {
|
109
|
-
let set1 = CustomSet::new(
|
110
|
-
let set2 = CustomSet::new(
|
109
|
+
let set1 = CustomSet::new(&[1]);
|
110
|
+
let set2 = CustomSet::new(&[]);
|
111
111
|
assert!(set1.is_disjoint(&set2));
|
112
112
|
}
|
113
113
|
|
114
114
|
#[test]
|
115
115
|
#[ignore]
|
116
116
|
fn sets_with_one_element_in_common_are_not_disjoint() {
|
117
|
-
let set1 = CustomSet::new(
|
118
|
-
let set2 = CustomSet::new(
|
117
|
+
let set1 = CustomSet::new(&[1, 2]);
|
118
|
+
let set2 = CustomSet::new(&[2, 3]);
|
119
119
|
assert!(!set1.is_disjoint(&set2));
|
120
120
|
assert!(!set2.is_disjoint(&set1));
|
121
121
|
}
|
@@ -123,8 +123,8 @@ fn sets_with_one_element_in_common_are_not_disjoint() {
|
|
123
123
|
#[test]
|
124
124
|
#[ignore]
|
125
125
|
fn sets_with_no_elements_in_common_are_disjoint() {
|
126
|
-
let set1 = CustomSet::new(
|
127
|
-
let set2 = CustomSet::new(
|
126
|
+
let set1 = CustomSet::new(&[1, 2]);
|
127
|
+
let set2 = CustomSet::new(&[3, 4]);
|
128
128
|
assert!(set1.is_disjoint(&set2));
|
129
129
|
assert!(set2.is_disjoint(&set1));
|
130
130
|
}
|
@@ -132,169 +132,169 @@ fn sets_with_no_elements_in_common_are_disjoint() {
|
|
132
132
|
#[test]
|
133
133
|
#[ignore]
|
134
134
|
fn empty_sets_are_equal() {
|
135
|
-
let set1: CustomSet<()> = CustomSet::new(
|
136
|
-
let set2: CustomSet<()> = CustomSet::new(
|
135
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
136
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
137
137
|
assert_eq!(set1, set2);
|
138
138
|
}
|
139
139
|
|
140
140
|
#[test]
|
141
141
|
#[ignore]
|
142
142
|
fn empty_set_is_not_equal_to_a_non_empty_set() {
|
143
|
-
let set1 = CustomSet::new(
|
144
|
-
let set2 = CustomSet::new(
|
143
|
+
let set1 = CustomSet::new(&[]);
|
144
|
+
let set2 = CustomSet::new(&[1, 2, 3]);
|
145
145
|
assert_ne!(set1, set2);
|
146
146
|
}
|
147
147
|
|
148
148
|
#[test]
|
149
149
|
#[ignore]
|
150
150
|
fn non_empty_set_is_not_equal_to_an_empty_set() {
|
151
|
-
let set1 = CustomSet::new(
|
152
|
-
let set2 = CustomSet::new(
|
151
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
152
|
+
let set2 = CustomSet::new(&[]);
|
153
153
|
assert_ne!(set1, set2);
|
154
154
|
}
|
155
155
|
|
156
156
|
#[test]
|
157
157
|
#[ignore]
|
158
158
|
fn sets_with_the_same_elements_are_equal() {
|
159
|
-
let set1 = CustomSet::new(
|
160
|
-
let set2 = CustomSet::new(
|
159
|
+
let set1 = CustomSet::new(&[1, 2]);
|
160
|
+
let set2 = CustomSet::new(&[2, 1]);
|
161
161
|
assert_eq!(set1, set2);
|
162
162
|
}
|
163
163
|
|
164
164
|
#[test]
|
165
165
|
#[ignore]
|
166
166
|
fn sets_with_different_elements_are_not_equal() {
|
167
|
-
let set1 = CustomSet::new(
|
168
|
-
let set2 = CustomSet::new(
|
167
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
168
|
+
let set2 = CustomSet::new(&[2, 1, 4]);
|
169
169
|
assert_ne!(set1, set2);
|
170
170
|
}
|
171
171
|
|
172
172
|
#[test]
|
173
173
|
#[ignore]
|
174
174
|
fn add_to_empty_set() {
|
175
|
-
let mut set = CustomSet::new(
|
175
|
+
let mut set = CustomSet::new(&[]);
|
176
176
|
set.add(3);
|
177
|
-
assert_eq!(set, CustomSet::new(
|
177
|
+
assert_eq!(set, CustomSet::new(&[3]));
|
178
178
|
}
|
179
179
|
|
180
180
|
#[test]
|
181
181
|
#[ignore]
|
182
182
|
fn add_to_non_empty_set() {
|
183
|
-
let mut set = CustomSet::new(
|
183
|
+
let mut set = CustomSet::new(&[1, 2, 4]);
|
184
184
|
set.add(3);
|
185
|
-
assert_eq!(set, CustomSet::new(
|
185
|
+
assert_eq!(set, CustomSet::new(&[1, 2, 3, 4]));
|
186
186
|
}
|
187
187
|
|
188
188
|
#[test]
|
189
189
|
#[ignore]
|
190
190
|
fn add_existing_element() {
|
191
|
-
let mut set = CustomSet::new(
|
191
|
+
let mut set = CustomSet::new(&[1, 2, 3]);
|
192
192
|
set.add(3);
|
193
|
-
assert_eq!(set, CustomSet::new(
|
193
|
+
assert_eq!(set, CustomSet::new(&[1, 2, 3]));
|
194
194
|
}
|
195
195
|
|
196
196
|
#[test]
|
197
197
|
#[ignore]
|
198
198
|
fn intersecting_empty_sets_return_empty_set() {
|
199
|
-
let set1: CustomSet<()> = CustomSet::new(
|
200
|
-
let set2: CustomSet<()> = CustomSet::new(
|
201
|
-
assert_eq!(set1.intersection(&set2), CustomSet::new(
|
199
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
200
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
201
|
+
assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
|
202
202
|
}
|
203
203
|
|
204
204
|
#[test]
|
205
205
|
#[ignore]
|
206
206
|
fn intersecting_empty_set_with_non_empty_returns_empty_set() {
|
207
|
-
let set1 = CustomSet::new(
|
208
|
-
let set2 = CustomSet::new(
|
209
|
-
assert_eq!(set1.intersection(&set2), CustomSet::new(
|
207
|
+
let set1 = CustomSet::new(&[]);
|
208
|
+
let set2 = CustomSet::new(&[3, 2, 5]);
|
209
|
+
assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
|
210
210
|
}
|
211
211
|
|
212
212
|
#[test]
|
213
213
|
#[ignore]
|
214
214
|
fn intersecting_non_empty_set_with_empty_returns_empty_set() {
|
215
|
-
let set1 = CustomSet::new(
|
216
|
-
let set2 = CustomSet::new(
|
217
|
-
assert_eq!(set1.intersection(&set2), CustomSet::new(
|
215
|
+
let set1 = CustomSet::new(&[1, 2, 3, 4]);
|
216
|
+
let set2 = CustomSet::new(&[]);
|
217
|
+
assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
|
218
218
|
}
|
219
219
|
|
220
220
|
#[test]
|
221
221
|
#[ignore]
|
222
222
|
fn intersection_of_two_sets_with_no_shared_elements_is_an_empty_set() {
|
223
|
-
let set1 = CustomSet::new(
|
224
|
-
let set2 = CustomSet::new(
|
225
|
-
assert_eq!(set1.intersection(&set2), CustomSet::new(
|
226
|
-
assert_eq!(set2.intersection(&set1), CustomSet::new(
|
223
|
+
let set1 = CustomSet::new(&[1, 2, 3]);
|
224
|
+
let set2 = CustomSet::new(&[4, 5, 6]);
|
225
|
+
assert_eq!(set1.intersection(&set2), CustomSet::new(&[]));
|
226
|
+
assert_eq!(set2.intersection(&set1), CustomSet::new(&[]));
|
227
227
|
}
|
228
228
|
|
229
229
|
#[test]
|
230
230
|
#[ignore]
|
231
231
|
fn intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements() {
|
232
|
-
let set1 = CustomSet::new(
|
233
|
-
let set2 = CustomSet::new(
|
234
|
-
assert_eq!(set1.intersection(&set2), CustomSet::new(
|
235
|
-
assert_eq!(set2.intersection(&set1), CustomSet::new(
|
232
|
+
let set1 = CustomSet::new(&[1, 2, 3, 4]);
|
233
|
+
let set2 = CustomSet::new(&[3, 2, 5]);
|
234
|
+
assert_eq!(set1.intersection(&set2), CustomSet::new(&[2, 3]));
|
235
|
+
assert_eq!(set2.intersection(&set1), CustomSet::new(&[2, 3]));
|
236
236
|
}
|
237
237
|
|
238
238
|
#[test]
|
239
239
|
#[ignore]
|
240
240
|
fn difference_of_two_empty_sets_is_empty_set() {
|
241
|
-
let set1: CustomSet<()> = CustomSet::new(
|
242
|
-
let set2: CustomSet<()> = CustomSet::new(
|
243
|
-
assert_eq!(set1.difference(&set2), CustomSet::new(
|
241
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
242
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
243
|
+
assert_eq!(set1.difference(&set2), CustomSet::new(&[]));
|
244
244
|
}
|
245
245
|
|
246
246
|
#[test]
|
247
247
|
#[ignore]
|
248
248
|
fn difference_of_an_empty_and_non_empty_set_is_an_empty_set() {
|
249
|
-
let set1 = CustomSet::new(
|
250
|
-
let set2 = CustomSet::new(
|
251
|
-
assert_eq!(set1.difference(&set2), CustomSet::new(
|
249
|
+
let set1 = CustomSet::new(&[]);
|
250
|
+
let set2 = CustomSet::new(&[3, 2, 5]);
|
251
|
+
assert_eq!(set1.difference(&set2), CustomSet::new(&[]));
|
252
252
|
}
|
253
253
|
|
254
254
|
#[test]
|
255
255
|
#[ignore]
|
256
256
|
fn difference_of_a_non_empty_set_and_empty_set_is_the_non_empty_set() {
|
257
|
-
let set1 = CustomSet::new(
|
258
|
-
let set2 = CustomSet::new(
|
259
|
-
assert_eq!(set1.difference(&set2), CustomSet::new(
|
257
|
+
let set1 = CustomSet::new(&[1, 2, 3, 4]);
|
258
|
+
let set2 = CustomSet::new(&[]);
|
259
|
+
assert_eq!(set1.difference(&set2), CustomSet::new(&[1, 2, 3, 4]));
|
260
260
|
}
|
261
261
|
|
262
262
|
#[test]
|
263
263
|
#[ignore]
|
264
264
|
fn difference_of_two_non_empty_sets_is_elements_only_in_first_set_one() {
|
265
|
-
let set1 = CustomSet::new(
|
266
|
-
let set2 = CustomSet::new(
|
267
|
-
assert_eq!(set1.difference(&set2), CustomSet::new(
|
265
|
+
let set1 = CustomSet::new(&[3, 2, 1]);
|
266
|
+
let set2 = CustomSet::new(&[2, 4]);
|
267
|
+
assert_eq!(set1.difference(&set2), CustomSet::new(&[1, 3]));
|
268
268
|
}
|
269
269
|
|
270
270
|
#[test]
|
271
271
|
#[ignore]
|
272
272
|
fn union_of_two_empty_sets_is_empty_set() {
|
273
|
-
let set1: CustomSet<()> = CustomSet::new(
|
274
|
-
let set2: CustomSet<()> = CustomSet::new(
|
275
|
-
assert_eq!(set1.union(&set2), CustomSet::new(
|
273
|
+
let set1: CustomSet<()> = CustomSet::new(&[]);
|
274
|
+
let set2: CustomSet<()> = CustomSet::new(&[]);
|
275
|
+
assert_eq!(set1.union(&set2), CustomSet::new(&[]));
|
276
276
|
}
|
277
277
|
|
278
278
|
#[test]
|
279
279
|
#[ignore]
|
280
280
|
fn union_of_empty_set_and_non_empty_set_is_all_elements() {
|
281
|
-
let set1 = CustomSet::new(
|
282
|
-
let set2 = CustomSet::new(
|
283
|
-
assert_eq!(set1.union(&set2), CustomSet::new(
|
281
|
+
let set1 = CustomSet::new(&[]);
|
282
|
+
let set2 = CustomSet::new(&[2]);
|
283
|
+
assert_eq!(set1.union(&set2), CustomSet::new(&[2]));
|
284
284
|
}
|
285
285
|
|
286
286
|
#[test]
|
287
287
|
#[ignore]
|
288
288
|
fn union_of_non_empty_set_and_empty_set_is_the_non_empty_set() {
|
289
|
-
let set1 = CustomSet::new(
|
290
|
-
let set2 = CustomSet::new(
|
291
|
-
assert_eq!(set1.union(&set2), CustomSet::new(
|
289
|
+
let set1 = CustomSet::new(&[1, 3]);
|
290
|
+
let set2 = CustomSet::new(&[]);
|
291
|
+
assert_eq!(set1.union(&set2), CustomSet::new(&[1, 3]));
|
292
292
|
}
|
293
293
|
|
294
294
|
#[test]
|
295
295
|
#[ignore]
|
296
296
|
fn union_of_non_empty_sets_contains_all_unique_elements() {
|
297
|
-
let set1 = CustomSet::new(
|
298
|
-
let set2 = CustomSet::new(
|
299
|
-
assert_eq!(set1.union(&set2), CustomSet::new(
|
297
|
+
let set1 = CustomSet::new(&[1, 3]);
|
298
|
+
let set2 = CustomSet::new(&[2, 3]);
|
299
|
+
assert_eq!(set1.union(&set2), CustomSet::new(&[3, 2, 1]));
|
300
300
|
}
|
@@ -44,7 +44,7 @@ haven't already, it will help you with organizing your files.
|
|
44
44
|
|
45
45
|
## Feedback, Issues, Pull Requests
|
46
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
|
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 are happy to help!
|
48
48
|
|
49
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
50
|
|
@@ -36,7 +36,7 @@ haven't already, it will help you with organizing your files.
|
|
36
36
|
|
37
37
|
## Feedback, Issues, Pull Requests
|
38
38
|
|
39
|
-
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
|
39
|
+
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 are happy to help!
|
40
40
|
|
41
41
|
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).
|
42
42
|
|
@@ -61,7 +61,7 @@ haven't already, it will help you with organizing your files.
|
|
61
61
|
|
62
62
|
## Feedback, Issues, Pull Requests
|
63
63
|
|
64
|
-
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
|
64
|
+
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 are happy to help!
|
65
65
|
|
66
66
|
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).
|
67
67
|
|
@@ -38,7 +38,7 @@ haven't already, it will help you with organizing your files.
|
|
38
38
|
|
39
39
|
## Feedback, Issues, Pull Requests
|
40
40
|
|
41
|
-
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
|
41
|
+
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 are happy to help!
|
42
42
|
|
43
43
|
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).
|
44
44
|
|
@@ -70,7 +70,7 @@ haven't already, it will help you with organizing your files.
|
|
70
70
|
|
71
71
|
## Feedback, Issues, Pull Requests
|
72
72
|
|
73
|
-
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
|
73
|
+
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 are happy to help!
|
74
74
|
|
75
75
|
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).
|
76
76
|
|
@@ -49,7 +49,7 @@ haven't already, it will help you with organizing your files.
|
|
49
49
|
|
50
50
|
## Feedback, Issues, Pull Requests
|
51
51
|
|
52
|
-
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
|
52
|
+
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 are happy to help!
|
53
53
|
|
54
54
|
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).
|
55
55
|
|
@@ -31,7 +31,7 @@ haven't already, it will help you with organizing your files.
|
|
31
31
|
|
32
32
|
## Feedback, Issues, Pull Requests
|
33
33
|
|
34
|
-
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
|
34
|
+
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 are happy to help!
|
35
35
|
|
36
36
|
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).
|
37
37
|
|
@@ -58,7 +58,7 @@ haven't already, it will help you with organizing your files.
|
|
58
58
|
|
59
59
|
## Feedback, Issues, Pull Requests
|
60
60
|
|
61
|
-
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
|
61
|
+
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 are happy to help!
|
62
62
|
|
63
63
|
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).
|
64
64
|
|
@@ -50,7 +50,7 @@ haven't already, it will help you with organizing your files.
|
|
50
50
|
|
51
51
|
## Feedback, Issues, Pull Requests
|
52
52
|
|
53
|
-
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
|
53
|
+
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 are happy to help!
|
54
54
|
|
55
55
|
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).
|
56
56
|
|
@@ -59,7 +59,7 @@ haven't already, it will help you with organizing your files.
|
|
59
59
|
|
60
60
|
## Feedback, Issues, Pull Requests
|
61
61
|
|
62
|
-
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
|
62
|
+
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 are happy to help!
|
63
63
|
|
64
64
|
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).
|
65
65
|
|
@@ -38,7 +38,7 @@ haven't already, it will help you with organizing your files.
|
|
38
38
|
|
39
39
|
## Feedback, Issues, Pull Requests
|
40
40
|
|
41
|
-
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
|
41
|
+
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 are happy to help!
|
42
42
|
|
43
43
|
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).
|
44
44
|
|
@@ -31,7 +31,7 @@ haven't already, it will help you with organizing your files.
|
|
31
31
|
|
32
32
|
## Feedback, Issues, Pull Requests
|
33
33
|
|
34
|
-
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
|
34
|
+
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 are happy to help!
|
35
35
|
|
36
36
|
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).
|
37
37
|
|
@@ -64,7 +64,7 @@ haven't already, it will help you with organizing your files.
|
|
64
64
|
|
65
65
|
## Feedback, Issues, Pull Requests
|
66
66
|
|
67
|
-
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
|
67
|
+
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 are happy to help!
|
68
68
|
|
69
69
|
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).
|
70
70
|
|
@@ -37,7 +37,7 @@ haven't already, it will help you with organizing your files.
|
|
37
37
|
|
38
38
|
## Feedback, Issues, Pull Requests
|
39
39
|
|
40
|
-
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
|
40
|
+
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 are happy to help!
|
41
41
|
|
42
42
|
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).
|
43
43
|
|
@@ -45,7 +45,7 @@ haven't already, it will help you with organizing your files.
|
|
45
45
|
|
46
46
|
## Feedback, Issues, Pull Requests
|
47
47
|
|
48
|
-
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
|
48
|
+
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 are happy to help!
|
49
49
|
|
50
50
|
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).
|
51
51
|
|
@@ -1,10 +1,16 @@
|
|
1
|
-
|
1
|
+
#[derive(Debug, PartialEq)]
|
2
|
+
pub enum Error {
|
3
|
+
SpanTooLong,
|
4
|
+
InvalidDigit(char),
|
5
|
+
}
|
6
|
+
|
7
|
+
pub fn lsp(string_digits: &str, span: usize) -> Result<u64, Error> {
|
2
8
|
if span == 0 {
|
3
9
|
return Ok(1);
|
4
10
|
}
|
5
11
|
|
6
|
-
if string_digits.chars().
|
7
|
-
return Err(
|
12
|
+
if let Some(invalid) = string_digits.chars().find(|c| !c.is_digit(10)) {
|
13
|
+
return Err(Error::InvalidDigit(invalid));
|
8
14
|
}
|
9
15
|
|
10
16
|
let products: Vec<u64> = string_digits.chars()
|
@@ -17,6 +23,6 @@ pub fn lsp(string_digits: &str, span: usize) -> Result<u64, String> {
|
|
17
23
|
if let Some(&x) = products.iter().max() {
|
18
24
|
Ok(x)
|
19
25
|
} else {
|
20
|
-
Err(
|
26
|
+
Err(Error::SpanTooLong)
|
21
27
|
}
|
22
28
|
}
|
@@ -65,7 +65,7 @@ fn returns_zero_if_all_products_are_zero() {
|
|
65
65
|
#[test]
|
66
66
|
#[ignore]
|
67
67
|
fn a_span_is_longer_than_number_is_an_error() {
|
68
|
-
|
68
|
+
assert_eq!(Err(Error::SpanTooLong), lsp("123", 4));
|
69
69
|
}
|
70
70
|
|
71
71
|
// There may be some confusion about whether this should be 1 or error.
|
@@ -95,11 +95,11 @@ fn a_non_empty_string_and_no_span_returns_one() {
|
|
95
95
|
#[test]
|
96
96
|
#[ignore]
|
97
97
|
fn empty_string_and_non_zero_span_is_an_error() {
|
98
|
-
|
98
|
+
assert_eq!(Err(Error::SpanTooLong), lsp("", 1));
|
99
99
|
}
|
100
100
|
|
101
101
|
#[test]
|
102
102
|
#[ignore]
|
103
103
|
fn a_string_with_non_digits_is_an_error() {
|
104
|
-
|
104
|
+
assert_eq!(Err(Error::InvalidDigit('a')), lsp("1234a5", 2));
|
105
105
|
}
|
@@ -50,7 +50,7 @@ haven't already, it will help you with organizing your files.
|
|
50
50
|
|
51
51
|
## Feedback, Issues, Pull Requests
|
52
52
|
|
53
|
-
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
|
53
|
+
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 are happy to help!
|
54
54
|
|
55
55
|
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).
|
56
56
|
|
@@ -88,7 +88,7 @@ haven't already, it will help you with organizing your files.
|
|
88
88
|
|
89
89
|
## Feedback, Issues, Pull Requests
|
90
90
|
|
91
|
-
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
|
91
|
+
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 are happy to help!
|
92
92
|
|
93
93
|
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).
|
94
94
|
|
@@ -34,7 +34,7 @@ haven't already, it will help you with organizing your files.
|
|
34
34
|
|
35
35
|
## Feedback, Issues, Pull Requests
|
36
36
|
|
37
|
-
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
|
37
|
+
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 are happy to help!
|
38
38
|
|
39
39
|
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).
|
40
40
|
|