trackler 2.2.1.107 → 2.2.1.108
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/pig-latin/description.md +4 -4
- data/tracks/c/config.json +42 -0
- data/tracks/c/exercises/bracket-push/README.md +3 -0
- data/tracks/c/exercises/bracket-push/makefile +25 -0
- data/tracks/c/exercises/bracket-push/src/example.c +52 -0
- data/tracks/c/exercises/bracket-push/src/example.h +7 -0
- data/tracks/c/exercises/bracket-push/test/test_bracket_push.c +132 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/etl/README.md +46 -0
- data/tracks/c/exercises/etl/makefile +25 -0
- data/tracks/c/exercises/etl/src/example.c +44 -0
- data/tracks/c/exercises/etl/src/example.h +18 -0
- data/tracks/c/exercises/etl/test/test_etl.c +120 -0
- data/tracks/c/exercises/etl/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/etl/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/etl/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/luhn/README.md +64 -0
- data/tracks/c/exercises/luhn/makefile +25 -0
- data/tracks/c/exercises/luhn/src/example.c +38 -0
- data/tracks/c/exercises/luhn/src/example.h +7 -0
- data/tracks/c/exercises/luhn/test/test_luhn.c +109 -0
- data/tracks/c/exercises/luhn/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/luhn/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/luhn/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/prime-factors/README.md +29 -0
- data/tracks/c/exercises/prime-factors/makefile +25 -0
- data/tracks/c/exercises/prime-factors/src/example.c +28 -0
- data/tracks/c/exercises/prime-factors/src/example.h +11 -0
- data/tracks/c/exercises/prime-factors/test/test_prime_factors.c +96 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity_internals.h +701 -0
- data/tracks/clojure/exercises/hello-world/src/example.clj +2 -3
- data/tracks/clojure/exercises/hello-world/test/hello_world_test.clj +0 -6
- data/tracks/common-lisp/README.md +3 -8
- data/tracks/common-lisp/config/exercise_readme.go.tmpl +1 -1
- data/tracks/common-lisp/exercises/acronym/README.md +1 -1
- data/tracks/common-lisp/exercises/acronym/acronym-test.lisp +0 -5
- data/tracks/common-lisp/exercises/allergies/README.md +1 -1
- data/tracks/common-lisp/exercises/anagram/README.md +1 -1
- data/tracks/common-lisp/exercises/atbash-cipher/README.md +1 -1
- data/tracks/common-lisp/exercises/beer-song/README.md +1 -1
- data/tracks/common-lisp/exercises/binary/README.md +1 -1
- data/tracks/common-lisp/exercises/bob/README.md +1 -1
- data/tracks/common-lisp/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/common-lisp/exercises/crypto-square/README.md +1 -1
- data/tracks/common-lisp/exercises/difference-of-squares/README.md +1 -1
- data/tracks/common-lisp/exercises/etl/README.md +1 -1
- data/tracks/common-lisp/exercises/gigasecond/README.md +1 -1
- data/tracks/common-lisp/exercises/grade-school/README.md +1 -1
- data/tracks/common-lisp/exercises/grains/README.md +1 -1
- data/tracks/common-lisp/exercises/hamming/README.md +1 -1
- data/tracks/common-lisp/exercises/hello-world/README.md +1 -1
- data/tracks/common-lisp/exercises/isogram/README.md +1 -1
- data/tracks/common-lisp/exercises/leap/README.md +1 -1
- data/tracks/common-lisp/exercises/meetup/README.md +1 -1
- data/tracks/common-lisp/exercises/nucleotide-count/README.md +1 -1
- data/tracks/common-lisp/exercises/pascals-triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/perfect-numbers/README.md +1 -1
- data/tracks/common-lisp/exercises/phone-number/README.md +1 -1
- data/tracks/common-lisp/exercises/prime-factors/README.md +1 -1
- data/tracks/common-lisp/exercises/raindrops/README.md +1 -1
- data/tracks/common-lisp/exercises/rna-transcription/README.md +1 -1
- data/tracks/common-lisp/exercises/robot-name/README.md +1 -1
- data/tracks/common-lisp/exercises/roman-numerals/README.md +1 -1
- data/tracks/common-lisp/exercises/scrabble-score/README.md +1 -1
- data/tracks/common-lisp/exercises/sieve/README.md +1 -1
- data/tracks/common-lisp/exercises/space-age/README.md +1 -1
- data/tracks/common-lisp/exercises/strain/README.md +1 -1
- data/tracks/common-lisp/exercises/sublist/README.md +1 -1
- data/tracks/common-lisp/exercises/triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/trinary/README.md +1 -1
- data/tracks/common-lisp/exercises/word-count/README.md +1 -1
- data/tracks/csharp/exercises/meetup/MeetupTest.cs +177 -177
- data/tracks/csharp/exercises/robot-simulator/Example.cs +27 -27
- data/tracks/csharp/exercises/robot-simulator/RobotSimulator.cs +3 -3
- data/tracks/csharp/exercises/robot-simulator/RobotSimulatorTest.cs +152 -31
- data/tracks/csharp/generators/Exercises/Meetup.cs +8 -9
- data/tracks/csharp/generators/Exercises/RobotSimulator.cs +116 -0
- data/tracks/delphi/exercises/allergies/uAllergyTests.pas +28 -0
- data/tracks/delphi/exercises/binary-search/uBinarySearchExample.pas +6 -0
- data/tracks/delphi/exercises/binary-search/uBinarySearchTest.pas +53 -37
- data/tracks/delphi/exercises/collatz-conjecture/uCollatzconjectureTest.pas +3 -0
- data/tracks/delphi/exercises/etl/uETLtests.pas +13 -10
- data/tracks/delphi/exercises/grains/uGrainsTests.pas +5 -2
- data/tracks/delphi/exercises/hamming/uHammingTests.pas +3 -0
- data/tracks/delphi/exercises/hello-world/uTestHelloWorld.pas +3 -0
- data/tracks/delphi/exercises/leap/uLeapTests.pas +3 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +3 -0
- data/tracks/delphi/exercises/nucleotide-count/uNucleotideCountTest.pas +5 -17
- data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersExample.pas +6 -0
- data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersTest.pas +77 -26
- data/tracks/delphi/exercises/pig-latin/README.md +4 -4
- data/tracks/delphi/exercises/pig-latin/uTestPigLatin.pas +12 -9
- data/tracks/delphi/exercises/poker/uPokerExample.pas +81 -26
- data/tracks/delphi/exercises/poker/uPokerTest.pas +343 -121
- data/tracks/delphi/exercises/raindrops/uRaindropsTest.pas +3 -0
- data/tracks/delphi/exercises/saddle-points/uSaddlePointsExample.pas +4 -3
- data/tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas +25 -47
- data/tracks/delphi/exercises/triangle/uTestTriangle.pas +4 -2
- data/tracks/delphi/exercises/two-fer/utwoferTest.pas +3 -0
- data/tracks/delphi/exercises/wordy/uWordyTests.pas +3 -0
- data/tracks/ecmascript/.travis.yml +2 -1
- data/tracks/ecmascript/config.json +14 -0
- data/tracks/ecmascript/exercises/accumulate/package.json +1 -2
- data/tracks/ecmascript/exercises/acronym/package.json +1 -2
- data/tracks/ecmascript/exercises/all-your-base/package.json +1 -2
- data/tracks/ecmascript/exercises/allergies/package.json +1 -2
- data/tracks/ecmascript/exercises/alphametics/package.json +1 -2
- data/tracks/ecmascript/exercises/anagram/package.json +1 -2
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/beer-song/package.json +1 -2
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +1 -2
- data/tracks/ecmascript/exercises/binary-search/package.json +1 -2
- data/tracks/ecmascript/exercises/binary/package.json +1 -2
- data/tracks/ecmascript/exercises/bob/README.md +2 -0
- data/tracks/ecmascript/exercises/bob/bob.spec.js +5 -5
- data/tracks/ecmascript/exercises/bob/example.js +7 -2
- data/tracks/ecmascript/exercises/bob/package.json +1 -2
- data/tracks/ecmascript/exercises/bowling/package.json +1 -2
- data/tracks/ecmascript/exercises/bracket-push/package.json +1 -2
- data/tracks/ecmascript/exercises/change/package.json +1 -2
- data/tracks/ecmascript/exercises/circular-buffer/package.json +1 -2
- data/tracks/ecmascript/exercises/clock/package.json +1 -2
- data/tracks/ecmascript/exercises/collatz-conjecture/package.json +1 -2
- data/tracks/ecmascript/exercises/complex-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/connect/package.json +1 -2
- data/tracks/ecmascript/exercises/crypto-square/package.json +1 -2
- data/tracks/ecmascript/exercises/custom-set/package.json +1 -2
- data/tracks/ecmascript/exercises/diamond/package.json +1 -2
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +1 -2
- data/tracks/ecmascript/exercises/diffie-hellman/package.json +1 -2
- data/tracks/ecmascript/exercises/etl/package.json +1 -2
- data/tracks/ecmascript/exercises/flatten-array/package.json +1 -2
- data/tracks/ecmascript/exercises/food-chain/package.json +1 -2
- data/tracks/ecmascript/exercises/gigasecond/package.json +1 -2
- data/tracks/ecmascript/exercises/grade-school/package.json +1 -2
- data/tracks/ecmascript/exercises/grains/package.json +1 -2
- data/tracks/ecmascript/exercises/hamming/package.json +1 -2
- data/tracks/ecmascript/exercises/hello-world/package.json +1 -2
- data/tracks/ecmascript/exercises/hexadecimal/package.json +1 -2
- data/tracks/ecmascript/exercises/house/package.json +1 -2
- data/tracks/ecmascript/exercises/isbn-verifier/package.json +1 -2
- data/tracks/ecmascript/exercises/isogram/package.json +1 -2
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +1 -2
- data/tracks/ecmascript/exercises/largest-series-product/package.json +1 -2
- data/tracks/ecmascript/exercises/leap/package.json +1 -2
- data/tracks/ecmascript/exercises/linked-list/package.json +1 -2
- data/tracks/ecmascript/exercises/list-ops/package.json +1 -2
- data/tracks/ecmascript/exercises/luhn/package.json +1 -2
- data/tracks/ecmascript/exercises/matrix/package.json +1 -2
- data/tracks/ecmascript/exercises/meetup/package.json +1 -2
- data/tracks/ecmascript/exercises/minesweeper/package.json +1 -2
- data/tracks/ecmascript/exercises/nth-prime/package.json +1 -2
- data/tracks/ecmascript/exercises/nucleotide-count/README.md +60 -0
- data/tracks/ecmascript/exercises/nucleotide-count/example.js +13 -0
- data/tracks/ecmascript/exercises/nucleotide-count/nucleotide-count.spec.js +23 -0
- data/tracks/ecmascript/exercises/nucleotide-count/package.json +70 -0
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/octal/package.json +1 -2
- data/tracks/ecmascript/exercises/palindrome-products/package.json +1 -2
- data/tracks/ecmascript/exercises/pangram/package.json +1 -2
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +1 -2
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/phone-number/package.json +1 -2
- data/tracks/ecmascript/exercises/pig-latin/package.json +1 -2
- data/tracks/ecmascript/exercises/prime-factors/package.json +1 -2
- data/tracks/ecmascript/exercises/protein-translation/package.json +1 -2
- data/tracks/ecmascript/exercises/proverb/package.json +1 -2
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +1 -2
- data/tracks/ecmascript/exercises/queen-attack/package.json +1 -2
- data/tracks/ecmascript/exercises/raindrops/package.json +1 -2
- data/tracks/ecmascript/exercises/react/package.json +1 -2
- data/tracks/ecmascript/exercises/rectangles/package.json +1 -2
- data/tracks/ecmascript/exercises/rna-transcription/package.json +1 -2
- data/tracks/ecmascript/exercises/robot-name/package.json +1 -2
- data/tracks/ecmascript/exercises/robot-simulator/package.json +1 -2
- data/tracks/ecmascript/exercises/roman-numerals/package.json +1 -2
- data/tracks/ecmascript/exercises/rotational-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/run-length-encoding/package.json +1 -2
- data/tracks/ecmascript/exercises/saddle-points/package.json +1 -2
- data/tracks/ecmascript/exercises/say/package.json +1 -2
- data/tracks/ecmascript/exercises/scrabble-score/package.json +1 -2
- data/tracks/ecmascript/exercises/secret-handshake/package.json +1 -2
- data/tracks/ecmascript/exercises/series/package.json +1 -2
- data/tracks/ecmascript/exercises/sieve/package.json +1 -2
- data/tracks/ecmascript/exercises/simple-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/simple-linked-list/package.json +1 -2
- data/tracks/ecmascript/exercises/space-age/package.json +1 -2
- data/tracks/ecmascript/exercises/spiral-matrix/package.json +1 -2
- data/tracks/ecmascript/exercises/strain/package.json +1 -2
- data/tracks/ecmascript/exercises/sublist/package.json +1 -2
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +1 -2
- data/tracks/ecmascript/exercises/transpose/package.json +1 -2
- data/tracks/ecmascript/exercises/triangle/package.json +1 -2
- data/tracks/ecmascript/exercises/trinary/package.json +1 -2
- data/tracks/ecmascript/exercises/twelve-days/package.json +1 -2
- data/tracks/ecmascript/exercises/two-bucket/package.json +1 -2
- data/tracks/ecmascript/exercises/two-fer/package.json +1 -2
- data/tracks/ecmascript/exercises/word-count/package.json +1 -2
- data/tracks/ecmascript/exercises/word-search/package.json +1 -2
- data/tracks/ecmascript/exercises/wordy/package.json +1 -2
- data/tracks/ecmascript/package.json +1 -2
- data/tracks/elm/config.json +13 -1
- data/tracks/elm/exercises/binary-search/BinarySearch.elm +9 -0
- data/tracks/elm/exercises/binary-search/BinarySearch.example.elm +36 -0
- data/tracks/elm/exercises/binary-search/README.md +71 -0
- data/tracks/elm/exercises/binary-search/elm-package.json +15 -0
- data/tracks/elm/exercises/binary-search/tests/Tests.elm +66 -0
- data/tracks/elm/exercises/binary-search/tests/elm-package.json +17 -0
- data/tracks/elm/exercises/hamming/Hamming.example.elm +3 -3
- data/tracks/elm/exercises/hamming/tests/Tests.elm +14 -14
- data/tracks/go/exercises/word-search/.meta/gen.go +9 -7
- data/tracks/go/exercises/word-search/cases_test.go +2 -2
- data/tracks/groovy/config.json +12 -0
- data/tracks/groovy/exercises/bank-account/BankAccount.groovy +30 -0
- data/tracks/groovy/exercises/bank-account/BankAccountSpec.groovy +200 -0
- data/tracks/groovy/exercises/bank-account/Example.groovy +47 -0
- data/tracks/groovy/exercises/bank-account/README.md +75 -0
- data/tracks/groovy/exercises/phone-number/Example.groovy +10 -14
- data/tracks/groovy/exercises/phone-number/PhoneNumber.groovy +2 -14
- data/tracks/groovy/exercises/phone-number/PhoneNumberSpec.groovy +39 -26
- data/tracks/groovy/exercises/phone-number/README.md +1 -1
- data/tracks/java/config.json +13 -0
- data/tracks/java/exercises/forth/README.md +10 -0
- data/tracks/java/exercises/rna-transcription/.meta/version +1 -1
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/sieve/.meta/version +1 -1
- data/tracks/java/exercises/spiral-matrix/.meta/version +1 -1
- data/tracks/java/exercises/triangle/.meta/version +1 -1
- data/tracks/java/exercises/two-bucket/README.md +1 -1
- data/tracks/java/exercises/zipper/.meta/src/reference/java/Zipper.java +199 -0
- data/tracks/java/exercises/zipper/.meta/version +1 -0
- data/tracks/java/exercises/zipper/README.md +42 -0
- data/tracks/java/exercises/zipper/build.gradle +18 -0
- data/tracks/java/exercises/zipper/src/main/java/.keep +0 -0
- data/tracks/java/exercises/zipper/src/test/java/ZipperTest.java +204 -0
- data/tracks/javascript/package.json +10 -0
- data/tracks/ocaml/.travis-ci.sh +1 -1
- data/tracks/ocaml/.travis.yml +1 -1
- data/tracks/ocaml/README.md +1 -1
- data/tracks/ocaml/config/exercise_readme.go.tmpl +2 -0
- data/tracks/python/config.json +13 -0
- data/tracks/python/exercises/all-your-base/all_your_base.py +1 -1
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +8 -8
- data/tracks/python/exercises/alphametics/alphametics_test.py +49 -9
- data/tracks/python/exercises/binary-search-tree/binary_search_tree.py +11 -5
- data/tracks/python/exercises/binary-search-tree/binary_search_tree_test.py +89 -48
- data/tracks/python/exercises/binary-search-tree/example.py +42 -52
- data/tracks/python/exercises/binary-search/binary_search_test.py +1 -1
- data/tracks/python/exercises/book-store/book_store_test.py +18 -39
- data/tracks/python/exercises/book-store/example.py +1 -1
- data/tracks/python/exercises/bowling/bowling.py +0 -2
- data/tracks/python/exercises/bowling/bowling_test.py +49 -13
- data/tracks/python/exercises/bowling/example.py +85 -135
- data/tracks/python/exercises/bracket-push/bracket_push.py +1 -1
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +16 -16
- data/tracks/python/exercises/bracket-push/example.py +2 -2
- data/tracks/python/exercises/change/change_test.py +17 -4
- data/tracks/python/exercises/change/example.py +2 -2
- data/tracks/python/exercises/circular-buffer/circular_buffer.py +12 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer_test.py +4 -11
- data/tracks/python/exercises/clock/clock.py +10 -1
- data/tracks/python/exercises/clock/clock_test.py +9 -9
- data/tracks/python/exercises/clock/example.py +4 -1
- data/tracks/python/exercises/collatz-conjecture/collatz_conjecture_test.py +15 -5
- data/tracks/python/exercises/collatz-conjecture/example.py +1 -1
- data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +37 -26
- data/tracks/python/exercises/custom-set/custom_set_test.py +1 -1
- data/tracks/python/exercises/diamond/diamond_test.py +1 -1
- data/tracks/python/exercises/dominoes/dominoes_test.py +1 -1
- data/tracks/python/exercises/forth/forth_test.py +1 -1
- data/tracks/python/exercises/house/example.py +11 -3
- data/tracks/python/exercises/house/house.py +1 -5
- data/tracks/python/exercises/house/house_test.py +269 -116
- data/tracks/python/exercises/list-ops/list_ops_test.py +1 -1
- data/tracks/python/exercises/luhn/luhn.py +3 -0
- data/tracks/python/exercises/luhn/luhn_test.py +1 -1
- data/tracks/python/exercises/markdown/markdown_test.py +2 -3
- data/tracks/python/exercises/minesweeper/minesweeper_test.py +1 -1
- data/tracks/python/exercises/nth-prime/nth_prime_test.py +1 -1
- data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +1 -1
- data/tracks/python/exercises/palindrome-products/palindrome_products_test.py +14 -6
- data/tracks/python/exercises/perfect-numbers/perfect_numbers_test.py +1 -24
- data/tracks/python/exercises/phone-number/phone_number_test.py +11 -3
- data/tracks/python/exercises/poker/example.py +4 -3
- data/tracks/python/exercises/poker/poker.py +1 -1
- data/tracks/python/exercises/poker/poker_test.py +196 -119
- data/tracks/python/exercises/pov/example.py +3 -3
- data/tracks/python/exercises/pov/pov.py +2 -2
- data/tracks/python/exercises/pov/pov_test.py +19 -18
- data/tracks/python/exercises/protein-translation/protein_translation_test.py +14 -24
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher_test.py +1 -1
- data/tracks/python/exercises/rational-numbers/README.md +59 -0
- data/tracks/python/exercises/rational-numbers/example.py +58 -0
- data/tracks/python/exercises/rational-numbers/rational_numbers.py +34 -0
- data/tracks/python/exercises/rational-numbers/rational_numbers_test.py +132 -0
- data/tracks/python/exercises/rectangles/rectangles_test.py +1 -1
- data/tracks/python/exercises/roman-numerals/roman_numerals_test.py +2 -1
- data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +2 -2
- data/tracks/python/exercises/saddle-points/saddle_points_test.py +18 -18
- data/tracks/python/exercises/scale-generator/example.py +4 -5
- data/tracks/python/exercises/scale-generator/scale_generator.py +2 -2
- data/tracks/python/exercises/scale-generator/scale_generator_test.py +38 -73
- data/tracks/python/exercises/secret-handshake/secret_handshake_test.py +1 -1
- data/tracks/python/exercises/tournament/tournament_test.py +1 -1
- data/tracks/python/exercises/twelve-days/example.py +3 -8
- data/tracks/python/exercises/twelve-days/twelve_days.py +1 -9
- data/tracks/python/exercises/twelve-days/twelve_days_test.py +51 -50
- data/tracks/python/exercises/two-bucket/example.py +3 -4
- data/tracks/python/exercises/two-bucket/two_bucket.py +1 -1
- data/tracks/python/exercises/two-bucket/two_bucket_test.py +8 -13
- data/tracks/python/exercises/two-fer/two_fer_test.py +8 -9
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +1 -1
- data/tracks/python/exercises/word-count/word_count_test.py +8 -14
- data/tracks/python/exercises/word-search/word_search.py +3 -15
- data/tracks/python/exercises/word-search/word_search_test.py +1 -1
- data/tracks/python/exercises/wordy/wordy_test.py +1 -1
- data/tracks/python/exercises/zebra-puzzle/example.py +11 -2
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +5 -1
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle_test.py +8 -5
- data/tracks/python/exercises/zipper/zipper_test.py +24 -30
- data/tracks/scala/exercises/dominoes/src/test/scala/DominoesTest.scala +2 -2
- data/tracks/scala/exercises/flatten-array/src/test/scala/FlattenArrayTest.scala +1 -1
- data/tracks/scala/exercises/food-chain/example.scala +3 -3
- data/tracks/scala/exercises/food-chain/src/test/scala/FoodChainTest.scala +12 -12
- data/tracks/scala/exercises/forth/src/test/scala/ForthTest.scala +35 -10
- data/tracks/scala/exercises/gigasecond/src/test/scala/GigasecondTest.scala +2 -2
- data/tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala +4 -4
- data/tracks/scala/exercises/hello-world/src/test/scala/HelloWorldTest.scala +2 -3
- data/tracks/scala/exercises/house/example.scala +4 -5
- data/tracks/scala/exercises/house/src/test/scala/HouseTest.scala +16 -17
- data/tracks/scala/exercises/isogram/src/test/scala/IsogramTest.scala +3 -3
- data/tracks/scala/exercises/kindergarten-garden/src/test/scala/GardenTest.scala +1 -29
- data/tracks/scala/exercises/largest-series-product/src/test/scala/SeriesTest.scala +20 -17
- data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +3 -3
- data/tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala +3 -3
- data/tracks/scala/exercises/matrix/example.scala +5 -1
- data/tracks/scala/exercises/matrix/src/test/scala/MatrixTest.scala +48 -12
- data/tracks/scala/exercises/meetup/src/test/scala/MeetupTest.scala +2 -1
- data/tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala +9 -9
- data/tracks/scala/testgen/src/main/scala/DominoesTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/FlattenArrayTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/FoodChainTestGenerator.scala +10 -12
- data/tracks/scala/testgen/src/main/scala/ForthTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/GigasecondTestGenerator.scala +6 -4
- data/tracks/scala/testgen/src/main/scala/HammingTestGenerator.scala +3 -3
- data/tracks/scala/testgen/src/main/scala/HouseTestGenerator.scala +10 -16
- data/tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/KindergartenGardenTestGenerator.scala +6 -5
- data/tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala +3 -3
- data/tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/MatrixTestGenerator.scala +35 -0
- data/tracks/scala/testgen/src/main/scala/MeetupTestGenerator.scala +14 -11
- data/tracks/scala/testgen/src/main/scala/MinesweeperTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/SeriesTestGenerator.scala +3 -3
- data/tracks/typescript/config/exercise_readme.go.tmpl +25 -4
- data/tracks/typescript/exercises/acronym/README.md +7 -2
- data/tracks/typescript/exercises/atbash-cipher/README.md +2 -1
- data/tracks/typescript/exercises/beer-song/README.md +2 -2
- data/tracks/typescript/exercises/binary-search-tree/README.md +2 -0
- data/tracks/typescript/exercises/circular-buffer/README.md +16 -7
- data/tracks/typescript/exercises/clock/README.md +6 -0
- data/tracks/typescript/exercises/diamond/README.md +8 -7
- data/tracks/typescript/exercises/etl/README.md +3 -1
- data/tracks/typescript/exercises/food-chain/README.md +1 -1
- data/tracks/typescript/exercises/grade-school/README.md +0 -1
- data/tracks/typescript/exercises/hello-world/.meta/hints.md +378 -0
- data/tracks/typescript/exercises/hello-world/README.md +37 -11
- data/tracks/typescript/exercises/largest-series-product/README.md +1 -6
- data/tracks/typescript/exercises/leap/README.md +1 -1
- data/tracks/typescript/exercises/linked-list/README.md +20 -15
- data/tracks/typescript/exercises/nth-prime/README.md +7 -2
- data/tracks/typescript/exercises/ocr-numbers/README.md +7 -6
- data/tracks/typescript/exercises/pangram/README.md +1 -1
- data/tracks/typescript/exercises/pascals-triangle/README.md +1 -1
- data/tracks/typescript/exercises/phone-number/README.md +4 -3
- data/tracks/typescript/exercises/prime-factors/README.md +1 -12
- data/tracks/typescript/exercises/pythagorean-triplet/README.md +3 -7
- data/tracks/typescript/exercises/rna-transcription/README.md +2 -2
- data/tracks/typescript/exercises/robot-simulator/README.md +3 -1
- data/tracks/typescript/exercises/scrabble-score/README.md +3 -1
- data/tracks/typescript/exercises/series/README.md +0 -4
- data/tracks/typescript/exercises/space-age/README.md +1 -1
- data/tracks/typescript/exercises/strain/README.md +6 -0
- data/tracks/typescript/exercises/sum-of-multiples/README.md +4 -7
- data/tracks/typescript/exercises/two-bucket/README.md +15 -19
- data/tracks/typescript/exercises/word-count/README.md +1 -2
- data/tracks/typescript/exercises/wordy/README.md +0 -5
- metadata +61 -5
- data/tracks/common-lisp/exercises/bob/.meta/description.md +0 -10
- data/tracks/javascript/.eslintrc.json +0 -10
- data/tracks/typescript/docs/EXERCISE_README_INSERT.md +0 -24
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from rectangles import count
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
8
|
class WordTest(unittest.TestCase):
|
9
9
|
def test_no_rows(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
import roman_numerals
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
8
|
class RomanTest(unittest.TestCase):
|
9
9
|
numerals = {
|
@@ -16,6 +16,7 @@ class RomanTest(unittest.TestCase):
|
|
16
16
|
9: 'IX',
|
17
17
|
27: 'XXVII',
|
18
18
|
48: 'XLVIII',
|
19
|
+
49: 'XLIX',
|
19
20
|
59: 'LIX',
|
20
21
|
93: 'XCIII',
|
21
22
|
141: 'CXLI',
|
@@ -3,9 +3,9 @@ import unittest
|
|
3
3
|
from run_length_encoding import encode, decode
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
|
-
class
|
8
|
+
class RunLengthEncodingTests(unittest.TestCase):
|
9
9
|
def test_encode_empty_string(self):
|
10
10
|
self.assertMultiLineEqual(encode(''), '')
|
11
11
|
|
@@ -10,36 +10,36 @@ import unittest
|
|
10
10
|
from saddle_points import saddle_points
|
11
11
|
|
12
12
|
|
13
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
13
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
14
14
|
|
15
15
|
class SaddlePointTest(unittest.TestCase):
|
16
|
-
def
|
17
|
-
|
18
|
-
self.assertEqual(saddle_points(
|
16
|
+
def test_identify_single_saddle_point(self):
|
17
|
+
matrix = [[9, 8, 7], [5, 3, 2], [6, 6, 7]]
|
18
|
+
self.assertEqual(saddle_points(matrix), set([(1, 0)]))
|
19
19
|
|
20
|
-
def
|
20
|
+
def test_empty_matrix_has_no_saddle_points(self):
|
21
21
|
self.assertEqual(saddle_points([]), set())
|
22
22
|
|
23
|
-
def
|
24
|
-
|
25
|
-
self.assertEqual(saddle_points(
|
23
|
+
def test_identify_lack_of_saddle_points_when_there_are_none(self):
|
24
|
+
matrix = [[1, 2, 3], [3, 1, 2], [2, 3, 1]]
|
25
|
+
self.assertEqual(saddle_points(matrix), set())
|
26
26
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
30
|
-
self.assertEqual(saddle_points(
|
27
|
+
def test_identify_multiple_saddle_points(self):
|
28
|
+
matrix = [[4, 5, 4], [3, 5, 5], [1, 5, 4]]
|
29
|
+
expected = set([(0, 1), (1, 1), (2, 1)])
|
30
|
+
self.assertEqual(saddle_points(matrix), expected)
|
31
31
|
|
32
|
-
def
|
33
|
-
|
34
|
-
|
35
|
-
self.assertEqual(saddle_points(
|
32
|
+
def test_identify_saddle_point_in_bottom_right_corner(self):
|
33
|
+
matrix = [[8, 7, 9], [6, 7, 6], [3, 2, 5]]
|
34
|
+
expected = set([(2, 2)])
|
35
|
+
self.assertEqual(saddle_points(matrix), expected)
|
36
36
|
|
37
37
|
# Additional tests for this track
|
38
38
|
|
39
39
|
def test_irregular_matrix(self):
|
40
|
-
|
40
|
+
matrix = [[3, 2, 1], [0, 1], [2, 1, 0]]
|
41
41
|
with self.assertRaisesWithMessage(ValueError):
|
42
|
-
saddle_points(
|
42
|
+
saddle_points(matrix)
|
43
43
|
|
44
44
|
# Utility functions
|
45
45
|
def setUp(self):
|
@@ -8,22 +8,21 @@ class Scale(object):
|
|
8
8
|
FLAT_KEYS = ['F', 'Bb', 'Eb', 'Ab', 'Db', 'Gb', 'd', 'g', 'c', 'f', 'bb',
|
9
9
|
'eb']
|
10
10
|
|
11
|
-
def __init__(self, tonic,
|
11
|
+
def __init__(self, tonic, intervals=None):
|
12
12
|
self.tonic = tonic.capitalize()
|
13
|
-
self.
|
14
|
-
self.pattern = pattern
|
13
|
+
self.intervals = intervals
|
15
14
|
self.chromatic_scale = (self.FLAT_CHROMATIC_SCALE
|
16
15
|
if tonic in self.FLAT_KEYS
|
17
16
|
else self.CHROMATIC_SCALE)
|
18
17
|
self.pitches = self._assign_pitches()
|
19
18
|
|
20
19
|
def _assign_pitches(self):
|
21
|
-
if self.
|
20
|
+
if self.intervals is None:
|
22
21
|
return self._reorder_chromatic_scale()
|
23
22
|
last_index = 0
|
24
23
|
pitches = []
|
25
24
|
scale = self._reorder_chromatic_scale()
|
26
|
-
for i, interval in enumerate(self.
|
25
|
+
for i, interval in enumerate(self.intervals):
|
27
26
|
pitches.append(scale[last_index])
|
28
27
|
last_index += self.ASCENDING_INTERVALS.index(interval) + 1
|
29
28
|
if pitches[0] != scale[last_index % len(scale)]:
|
@@ -1,3 +1,3 @@
|
|
1
1
|
class Scale(object):
|
2
|
-
def __init__(self, tonic,
|
3
|
-
|
2
|
+
def __init__(self, tonic, intervals=None):
|
3
|
+
self.pitches = None
|
@@ -3,121 +3,86 @@ import unittest
|
|
3
3
|
from scale_generator import Scale
|
4
4
|
|
5
5
|
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0
|
7
|
+
|
6
8
|
class ScaleGeneratorTest(unittest.TestCase):
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
expected = 'C
|
11
|
-
|
12
|
-
self.assertEqual(
|
13
|
-
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
def test_another_chromatic_scale(self):
|
22
|
-
chromatic = Scale('F', 'chromatic')
|
23
|
-
expected = ['F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B', 'C', 'Db', 'D', 'Eb',
|
24
|
-
'E']
|
25
|
-
actual = chromatic.pitches
|
26
|
-
self.assertEqual(expected, actual)
|
27
|
-
|
28
|
-
def test_naming_major_scale(self):
|
29
|
-
major = Scale('G', 'major', 'MMmMMMm')
|
30
|
-
expected = 'G major'
|
31
|
-
actual = major.name
|
32
|
-
self.assertEqual(expected, actual)
|
33
|
-
|
34
|
-
def test_major_scale(self):
|
35
|
-
major = Scale('C', 'major', 'MMmMMMm')
|
10
|
+
# Test chromatic scales
|
11
|
+
def test_chromatic_scale_with_sharps(self):
|
12
|
+
expected = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#',
|
13
|
+
'G', 'G#', 'A', 'A#', 'B']
|
14
|
+
self.assertEqual(Scale('C').pitches, expected)
|
15
|
+
|
16
|
+
def test_chromatic_scale_with_flats(self):
|
17
|
+
expected = ['F', 'Gb', 'G', 'Ab', 'A', 'Bb', 'B',
|
18
|
+
'C', 'Db', 'D', 'Eb', 'E']
|
19
|
+
self.assertEqual(Scale('F').pitches, expected)
|
20
|
+
|
21
|
+
# Test scales with specified intervals
|
22
|
+
def test_simple_major_scale(self):
|
36
23
|
expected = ['C', 'D', 'E', 'F', 'G', 'A', 'B']
|
37
|
-
|
38
|
-
self.assertEqual(expected, actual)
|
24
|
+
self.assertEqual(Scale('C', 'MMmMMMm').pitches, expected)
|
39
25
|
|
40
|
-
def
|
41
|
-
major = Scale('G', 'major', 'MMmMMMm')
|
26
|
+
def test_major_scale_with_sharps(self):
|
42
27
|
expected = ['G', 'A', 'B', 'C', 'D', 'E', 'F#']
|
43
|
-
|
44
|
-
|
28
|
+
self.assertEqual(Scale('G', 'MMmMMMm').pitches, expected)
|
29
|
+
|
30
|
+
def test_major_scale_with_flats(self):
|
31
|
+
expected = ['F', 'G', 'A', 'Bb', 'C', 'D', 'E']
|
32
|
+
self.assertEqual(Scale('F', 'MMmMMMm').pitches, expected)
|
45
33
|
|
46
|
-
def
|
47
|
-
minor = Scale('f#', 'minor', 'MmMMmMM')
|
34
|
+
def test_minor_scale_with_sharps(self):
|
48
35
|
expected = ['F#', 'G#', 'A', 'B', 'C#', 'D', 'E']
|
49
|
-
|
50
|
-
self.assertEqual(expected, actual)
|
36
|
+
self.assertEqual(Scale('f#', 'MmMMmMM').pitches, expected)
|
51
37
|
|
52
|
-
def
|
53
|
-
minor = Scale('bb', 'minor', 'MmMMmMM')
|
38
|
+
def test_minor_scale_with_flats(self):
|
54
39
|
expected = ['Bb', 'C', 'Db', 'Eb', 'F', 'Gb', 'Ab']
|
55
|
-
|
56
|
-
self.assertEqual(expected, actual)
|
40
|
+
self.assertEqual(Scale('bb', 'MmMMmMM').pitches, expected)
|
57
41
|
|
58
42
|
def test_dorian_mode(self):
|
59
|
-
dorian = Scale('d', 'dorian', 'MmMMMmM')
|
60
43
|
expected = ['D', 'E', 'F', 'G', 'A', 'B', 'C']
|
61
|
-
|
62
|
-
self.assertEqual(expected, actual)
|
44
|
+
self.assertEqual(Scale('d', 'MmMMMmM').pitches, expected)
|
63
45
|
|
64
46
|
def test_mixolydian_mode(self):
|
65
|
-
mixolydian = Scale('Eb', 'mixolydian', 'MMmMMmM')
|
66
47
|
expected = ['Eb', 'F', 'G', 'Ab', 'Bb', 'C', 'Db']
|
67
|
-
|
68
|
-
self.assertEqual(expected, actual)
|
48
|
+
self.assertEqual(Scale('Eb', 'MMmMMmM').pitches, expected)
|
69
49
|
|
70
50
|
def test_lydian_mode(self):
|
71
|
-
lydian = Scale('a', 'lydian', 'MMMmMMm')
|
72
51
|
expected = ['A', 'B', 'C#', 'D#', 'E', 'F#', 'G#']
|
73
|
-
|
74
|
-
self.assertEqual(expected, actual)
|
52
|
+
self.assertEqual(Scale('a', 'MMMmMMm').pitches, expected)
|
75
53
|
|
76
54
|
def test_phrygian_mode(self):
|
77
|
-
phrygian = Scale('e', 'phrygian', 'mMMMmMM')
|
78
55
|
expected = ['E', 'F', 'G', 'A', 'B', 'C', 'D']
|
79
|
-
|
80
|
-
self.assertEqual(expected, actual)
|
56
|
+
self.assertEqual(Scale('e', 'mMMMmMM').pitches, expected)
|
81
57
|
|
82
58
|
def test_locrian_mode(self):
|
83
|
-
locrian = Scale('g', 'locrian', 'mMMmMMM')
|
84
59
|
expected = ['G', 'Ab', 'Bb', 'C', 'Db', 'Eb', 'F']
|
85
|
-
|
86
|
-
self.assertEqual(expected, actual)
|
60
|
+
self.assertEqual(Scale('g', 'mMMmMMM').pitches, expected)
|
87
61
|
|
88
62
|
def test_harmonic_minor(self):
|
89
|
-
harmonic_minor = Scale('d', 'harmonic_minor', 'MmMMmAm')
|
90
63
|
expected = ['D', 'E', 'F', 'G', 'A', 'Bb', 'Db']
|
91
|
-
|
92
|
-
self.assertEqual(expected, actual)
|
64
|
+
self.assertEqual(Scale('d', 'MmMMmAm').pitches, expected)
|
93
65
|
|
94
66
|
def test_octatonic(self):
|
95
|
-
octatonic = Scale('C', 'octatonic', 'MmMmMmMm')
|
96
67
|
expected = ['C', 'D', 'D#', 'F', 'F#', 'G#', 'A', 'B']
|
97
|
-
|
98
|
-
self.assertEqual(expected, actual)
|
68
|
+
self.assertEqual(Scale('C', 'MmMmMmMm').pitches, expected)
|
99
69
|
|
100
70
|
def test_hexatonic(self):
|
101
|
-
hexatonic = Scale('Db', 'hexatonic', 'MMMMMM')
|
102
71
|
expected = ['Db', 'Eb', 'F', 'G', 'A', 'B']
|
103
|
-
|
104
|
-
self.assertEqual(expected, actual)
|
72
|
+
self.assertEqual(Scale('Db', 'MMMMMM').pitches, expected)
|
105
73
|
|
106
74
|
def test_pentatonic(self):
|
107
|
-
pentatonic = Scale('A', 'pentatonic', 'MMAMA')
|
108
75
|
expected = ['A', 'B', 'C#', 'E', 'F#']
|
109
|
-
|
110
|
-
self.assertEqual(expected, actual)
|
76
|
+
self.assertEqual(Scale('A', 'MMAMA').pitches, expected)
|
111
77
|
|
112
78
|
def test_enigmatic(self):
|
113
|
-
enigmatic = Scale('G', 'enigmatic', 'mAMMMmm')
|
114
79
|
expected = ['G', 'G#', 'B', 'C#', 'D#', 'F', 'F#']
|
115
|
-
|
116
|
-
self.assertEqual(expected, actual)
|
80
|
+
self.assertEqual(Scale('G', 'mAMMMmm').pitches, expected)
|
117
81
|
|
82
|
+
# Track-specific tests
|
118
83
|
def test_brokeninterval(self):
|
119
84
|
with self.assertRaisesWithMessage(ValueError):
|
120
|
-
Scale('G', '
|
85
|
+
Scale('G', 'mAMMMmM')
|
121
86
|
|
122
87
|
# Utility functions
|
123
88
|
def setUp(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from secret_handshake import handshake, secret_code
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
8
|
class HandshakeTest(unittest.TestCase):
|
9
9
|
def test_wink_for_1(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from tournament import tally
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
|
7
7
|
|
8
8
|
class TestTournament(unittest.TestCase):
|
9
9
|
def test_just_the_header_if_no_input(self):
|
@@ -20,14 +20,9 @@ def verse(day_number):
|
|
20
20
|
if len(gifts) > 1:
|
21
21
|
gifts[:-1] = [', '.join(gifts[:-1])]
|
22
22
|
gifts = ', and '.join(gifts)
|
23
|
-
return 'On the {} day of Christmas my true love gave to me, {}
|
23
|
+
return 'On the {} day of Christmas my true love gave to me, {}.'.format(
|
24
24
|
ORDINAL[day_number], gifts)
|
25
25
|
|
26
26
|
|
27
|
-
def
|
28
|
-
return
|
29
|
-
for n in range(start, end + 1)])
|
30
|
-
|
31
|
-
|
32
|
-
def sing():
|
33
|
-
return verses(1, 12)
|
27
|
+
def recite(start, end):
|
28
|
+
return [verse(n) for n in range(start, end + 1)]
|
@@ -1,67 +1,69 @@
|
|
1
1
|
import unittest
|
2
2
|
|
3
|
-
from twelve_days import
|
3
|
+
from twelve_days import recite
|
4
4
|
|
5
5
|
|
6
|
-
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
|
+
|
8
|
+
class VerseTests(unittest.TestCase):
|
7
9
|
def test_verse1(self):
|
8
|
-
expected =
|
9
|
-
"a Partridge in a Pear Tree
|
10
|
-
self.assertEqual(
|
10
|
+
expected = ["On the first day of Christmas my true love gave to me, "
|
11
|
+
"a Partridge in a Pear Tree."]
|
12
|
+
self.assertEqual(recite(1, 1), expected)
|
11
13
|
|
12
14
|
def test_verse2(self):
|
13
|
-
expected =
|
15
|
+
expected = ["On the second day of Christmas my true love gave to me, "
|
14
16
|
"two Turtle Doves, "
|
15
|
-
"and a Partridge in a Pear Tree
|
16
|
-
self.assertEqual(
|
17
|
+
"and a Partridge in a Pear Tree."]
|
18
|
+
self.assertEqual(recite(2, 2), expected)
|
17
19
|
|
18
20
|
def test_verse3(self):
|
19
|
-
expected =
|
21
|
+
expected = ["On the third day of Christmas my true love gave to me, "
|
20
22
|
"three French Hens, "
|
21
23
|
"two Turtle Doves, "
|
22
|
-
"and a Partridge in a Pear Tree
|
23
|
-
self.assertEqual(
|
24
|
+
"and a Partridge in a Pear Tree."]
|
25
|
+
self.assertEqual(recite(3, 3), expected)
|
24
26
|
|
25
27
|
def test_verse4(self):
|
26
|
-
expected =
|
28
|
+
expected = ["On the fourth day of Christmas my true love gave to me, "
|
27
29
|
"four Calling Birds, "
|
28
30
|
"three French Hens, "
|
29
31
|
"two Turtle Doves, "
|
30
|
-
"and a Partridge in a Pear Tree
|
31
|
-
self.assertEqual(
|
32
|
+
"and a Partridge in a Pear Tree."]
|
33
|
+
self.assertEqual(recite(4, 4), expected)
|
32
34
|
|
33
35
|
def test_verse5(self):
|
34
|
-
expected =
|
36
|
+
expected = ["On the fifth day of Christmas my true love gave to me, "
|
35
37
|
"five Gold Rings, "
|
36
38
|
"four Calling Birds, "
|
37
39
|
"three French Hens, "
|
38
40
|
"two Turtle Doves, "
|
39
|
-
"and a Partridge in a Pear Tree
|
40
|
-
self.assertEqual(
|
41
|
+
"and a Partridge in a Pear Tree."]
|
42
|
+
self.assertEqual(recite(5, 5), expected)
|
41
43
|
|
42
44
|
def test_verse6(self):
|
43
|
-
expected =
|
45
|
+
expected = ["On the sixth day of Christmas my true love gave to me, "
|
44
46
|
"six Geese-a-Laying, "
|
45
47
|
"five Gold Rings, "
|
46
48
|
"four Calling Birds, "
|
47
49
|
"three French Hens, "
|
48
50
|
"two Turtle Doves, "
|
49
|
-
"and a Partridge in a Pear Tree
|
50
|
-
self.assertEqual(
|
51
|
+
"and a Partridge in a Pear Tree."]
|
52
|
+
self.assertEqual(recite(6, 6), expected)
|
51
53
|
|
52
54
|
def test_verse7(self):
|
53
|
-
expected =
|
55
|
+
expected = ["On the seventh day of Christmas my true love gave to me, "
|
54
56
|
"seven Swans-a-Swimming, "
|
55
57
|
"six Geese-a-Laying, "
|
56
58
|
"five Gold Rings, "
|
57
59
|
"four Calling Birds, "
|
58
60
|
"three French Hens, "
|
59
61
|
"two Turtle Doves, "
|
60
|
-
"and a Partridge in a Pear Tree
|
61
|
-
self.assertEqual(
|
62
|
+
"and a Partridge in a Pear Tree."]
|
63
|
+
self.assertEqual(recite(7, 7), expected)
|
62
64
|
|
63
65
|
def test_verse8(self):
|
64
|
-
expected =
|
66
|
+
expected = ["On the eighth day of Christmas my true love gave to me, "
|
65
67
|
"eight Maids-a-Milking, "
|
66
68
|
"seven Swans-a-Swimming, "
|
67
69
|
"six Geese-a-Laying, "
|
@@ -69,11 +71,11 @@ class TwelveDaysTests(unittest.TestCase):
|
|
69
71
|
"four Calling Birds, "
|
70
72
|
"three French Hens, "
|
71
73
|
"two Turtle Doves, "
|
72
|
-
"and a Partridge in a Pear Tree
|
73
|
-
self.assertEqual(
|
74
|
+
"and a Partridge in a Pear Tree."]
|
75
|
+
self.assertEqual(recite(8, 8), expected)
|
74
76
|
|
75
77
|
def test_verse9(self):
|
76
|
-
expected =
|
78
|
+
expected = ["On the ninth day of Christmas my true love gave to me, "
|
77
79
|
"nine Ladies Dancing, "
|
78
80
|
"eight Maids-a-Milking, "
|
79
81
|
"seven Swans-a-Swimming, "
|
@@ -82,11 +84,11 @@ class TwelveDaysTests(unittest.TestCase):
|
|
82
84
|
"four Calling Birds, "
|
83
85
|
"three French Hens, "
|
84
86
|
"two Turtle Doves, "
|
85
|
-
"and a Partridge in a Pear Tree
|
86
|
-
self.assertEqual(
|
87
|
+
"and a Partridge in a Pear Tree."]
|
88
|
+
self.assertEqual(recite(9, 9), expected)
|
87
89
|
|
88
90
|
def test_verse10(self):
|
89
|
-
expected =
|
91
|
+
expected = ["On the tenth day of Christmas my true love gave to me, "
|
90
92
|
"ten Lords-a-Leaping, "
|
91
93
|
"nine Ladies Dancing, "
|
92
94
|
"eight Maids-a-Milking, "
|
@@ -96,11 +98,11 @@ class TwelveDaysTests(unittest.TestCase):
|
|
96
98
|
"four Calling Birds, "
|
97
99
|
"three French Hens, "
|
98
100
|
"two Turtle Doves, "
|
99
|
-
"and a Partridge in a Pear Tree
|
100
|
-
self.assertEqual(
|
101
|
+
"and a Partridge in a Pear Tree."]
|
102
|
+
self.assertEqual(recite(10, 10), expected)
|
101
103
|
|
102
104
|
def test_verse11(self):
|
103
|
-
expected =
|
105
|
+
expected = ["On the eleventh day of Christmas "
|
104
106
|
"my true love gave to me, "
|
105
107
|
"eleven Pipers Piping, "
|
106
108
|
"ten Lords-a-Leaping, "
|
@@ -112,11 +114,11 @@ class TwelveDaysTests(unittest.TestCase):
|
|
112
114
|
"four Calling Birds, "
|
113
115
|
"three French Hens, "
|
114
116
|
"two Turtle Doves, "
|
115
|
-
"and a Partridge in a Pear Tree
|
116
|
-
self.assertEqual(
|
117
|
+
"and a Partridge in a Pear Tree."]
|
118
|
+
self.assertEqual(recite(11, 11), expected)
|
117
119
|
|
118
120
|
def test_verse12(self):
|
119
|
-
expected =
|
121
|
+
expected = ["On the twelfth day of Christmas my true love gave to me, "
|
120
122
|
"twelve Drummers Drumming, "
|
121
123
|
"eleven Pipers Piping, "
|
122
124
|
"ten Lords-a-Leaping, "
|
@@ -128,23 +130,22 @@ class TwelveDaysTests(unittest.TestCase):
|
|
128
130
|
"four Calling Birds, "
|
129
131
|
"three French Hens, "
|
130
132
|
"two Turtle Doves, "
|
131
|
-
"and a Partridge in a Pear Tree
|
132
|
-
self.assertEqual(
|
133
|
+
"and a Partridge in a Pear Tree."]
|
134
|
+
self.assertEqual(recite(12, 12), expected)
|
133
135
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
"and a Partridge in a Pear Tree.\n\n")
|
144
|
-
self.assertEqual(verses(1, 3), expected)
|
136
|
+
|
137
|
+
class LyricsTests(unittest.TestCase):
|
138
|
+
def test_first_three_verses_of_the_song(self):
|
139
|
+
expected = [recite(n, n)[0] for n in range(1, 4)]
|
140
|
+
self.assertEqual(recite(1, 3), expected)
|
141
|
+
|
142
|
+
def test_three_verses_from_the_middle_of_the_song(self):
|
143
|
+
expected = [recite(n, n)[0] for n in range(4, 7)]
|
144
|
+
self.assertEqual(recite(4, 6), expected)
|
145
145
|
|
146
146
|
def test_the_whole_song(self):
|
147
|
-
|
147
|
+
expected = [recite(n, n)[0] for n in range(1, 13)]
|
148
|
+
self.assertEqual(recite(1, 12), expected)
|
148
149
|
|
149
150
|
|
150
151
|
if __name__ == '__main__':
|