trackler 2.2.1.56 → 2.2.1.57
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/TOPICS.txt +2 -2
- data/problem-specifications/exercises/zipper/description.md +1 -1
- data/tracks/dart/test/exercises_test.dart +9 -9
- data/tracks/delphi/exercises/circular-buffer/uCircularBufferExample.pas +3 -3
- data/tracks/delphi/exercises/circular-buffer/uCircularBufferTests.pas +160 -86
- data/tracks/delphi/exercises/phone-number/README.md +1 -1
- data/tracks/erlang/config.json +10 -0
- data/tracks/erlang/exercises/isogram/README.md +65 -0
- data/tracks/erlang/exercises/isogram/include/exercism.hrl +11 -0
- data/tracks/erlang/exercises/isogram/rebar.config +30 -0
- data/tracks/erlang/exercises/isogram/src/example.erl +16 -0
- data/tracks/erlang/exercises/isogram/src/isogram.app.src +9 -0
- data/tracks/erlang/exercises/isogram/src/isogram.erl +9 -0
- data/tracks/erlang/exercises/isogram/test/isogram_tests.erl +32 -0
- data/tracks/fsharp/exercises/binary-search/BinarySearch.fs +1 -1
- data/tracks/fsharp/exercises/binary-search/BinarySearchTest.fs +58 -30
- data/tracks/fsharp/exercises/binary-search/Example.fs +1 -1
- data/tracks/fsharp/exercises/poker/Example.fs +23 -20
- data/tracks/fsharp/exercises/poker/PokerTest.fs +135 -76
- data/tracks/fsharp/generators/Generators.fs +21 -0
- data/tracks/go/README.md +0 -15
- data/tracks/go/bin/run-generators +11 -0
- data/tracks/go/config.json +389 -277
- data/tracks/go/config/maintainers.json +2 -2
- data/tracks/go/docs/TESTS.md +0 -15
- data/tracks/go/exercises/accumulate/accumulate_test.go +0 -8
- data/tracks/go/exercises/accumulate/example.go +0 -2
- data/tracks/go/exercises/acronym/acronym.go +14 -2
- data/tracks/go/exercises/acronym/acronym_test.go +0 -8
- data/tracks/go/exercises/acronym/cases_test.go +2 -2
- data/tracks/go/exercises/acronym/example.go +0 -2
- data/tracks/go/exercises/all-your-base/all_your_base_test.go +0 -8
- data/tracks/go/exercises/all-your-base/example.go +0 -2
- data/tracks/go/exercises/allergies/allergies_test.go +0 -8
- data/tracks/go/exercises/allergies/example.go +0 -2
- data/tracks/go/exercises/anagram/.meta/gen.go +55 -0
- data/tracks/go/exercises/anagram/anagram_test.go +0 -130
- data/tracks/go/exercises/anagram/cases_test.go +164 -0
- data/tracks/go/exercises/anagram/example.go +0 -2
- data/tracks/go/exercises/atbash-cipher/atbash_cipher_test.go +0 -8
- data/tracks/go/exercises/atbash-cipher/cases_test.go +2 -2
- data/tracks/go/exercises/atbash-cipher/example.go +0 -2
- data/tracks/go/exercises/bank-account/bank_account_test.go +0 -8
- data/tracks/go/exercises/bank-account/example.go +0 -2
- data/tracks/go/exercises/beer-song/beer_test.go +0 -8
- data/tracks/go/exercises/beer-song/example.go +0 -2
- data/tracks/go/exercises/binary-search-tree/binary_search_tree_test.go +0 -8
- data/tracks/go/exercises/binary-search-tree/example.go +0 -2
- data/tracks/go/exercises/binary-search/binary_search_test.go +0 -8
- data/tracks/go/exercises/binary-search/example.go +0 -2
- data/tracks/go/exercises/binary/binary_test.go +0 -11
- data/tracks/go/exercises/binary/example.go +0 -2
- data/tracks/go/exercises/bob/bob.go +14 -0
- data/tracks/go/exercises/bob/bob_test.go +2 -10
- data/tracks/go/exercises/bob/cases_test.go +2 -2
- data/tracks/go/exercises/bob/example.go +12 -13
- data/tracks/go/exercises/book-store/README.md +92 -0
- data/tracks/go/exercises/book-store/book_store_test.go +91 -0
- data/tracks/go/exercises/book-store/example.go +52 -0
- data/tracks/go/exercises/bowling/bowling_test.go +0 -8
- data/tracks/go/exercises/bowling/cases_test.go +2 -2
- data/tracks/go/exercises/bowling/example.go +0 -2
- data/tracks/go/exercises/bracket-push/bracket_push_test.go +0 -8
- data/tracks/go/exercises/bracket-push/cases_test.go +2 -2
- data/tracks/go/exercises/bracket-push/example.go +0 -3
- data/tracks/go/exercises/change/cases_test.go +10 -3
- data/tracks/go/exercises/change/change_test.go +1 -9
- data/tracks/go/exercises/change/example.go +0 -2
- data/tracks/go/exercises/circular-buffer/circular_buffer_test.go +0 -8
- data/tracks/go/exercises/circular-buffer/example.go +0 -2
- data/tracks/go/exercises/clock/cases_test.go +2 -2
- data/tracks/go/exercises/clock/clock_test.go +2 -9
- data/tracks/go/exercises/clock/example.go +0 -2
- data/tracks/go/exercises/collatz-conjecture/README.md +51 -0
- data/tracks/go/exercises/collatz-conjecture/collatz_conjecture_test.go +77 -0
- data/tracks/go/exercises/collatz-conjecture/example.go +24 -0
- data/tracks/go/exercises/connect/cases_test.go +2 -2
- data/tracks/go/exercises/connect/connect_test.go +0 -8
- data/tracks/go/exercises/connect/example.go +0 -2
- data/tracks/go/exercises/crypto-square/crypto_square_test.go +0 -8
- data/tracks/go/exercises/crypto-square/example.go +0 -2
- data/tracks/go/exercises/custom-set/cases_test.go +2 -2
- data/tracks/go/exercises/custom-set/custom_set_test.go +0 -8
- data/tracks/go/exercises/custom-set/example.go +0 -2
- data/tracks/go/exercises/custom-set/example_slice.go +0 -2
- data/tracks/go/exercises/diamond/diamond_test.go +0 -8
- data/tracks/go/exercises/diamond/example.go +0 -2
- data/tracks/go/exercises/difference-of-squares/difference_of_squares_test.go +0 -8
- data/tracks/go/exercises/difference-of-squares/example.go +0 -2
- data/tracks/go/exercises/diffie-hellman/diffie_hellman_test.go +0 -8
- data/tracks/go/exercises/diffie-hellman/example.go +0 -2
- data/tracks/go/exercises/error-handling/error_handling_test.go +0 -7
- data/tracks/go/exercises/error-handling/example.go +0 -2
- data/tracks/go/exercises/etl/etl_test.go +0 -8
- data/tracks/go/exercises/etl/example.go +0 -2
- data/tracks/go/exercises/flatten-array/.meta/gen.go +52 -0
- data/tracks/go/exercises/flatten-array/README.md +35 -0
- data/tracks/go/exercises/flatten-array/cases_test.go +42 -0
- data/tracks/go/exercises/flatten-array/example.go +25 -0
- data/tracks/go/exercises/flatten-array/flatten_test.go +23 -0
- data/tracks/go/exercises/food-chain/example.go +0 -2
- data/tracks/go/exercises/food-chain/food_chain_test.go +0 -8
- data/tracks/go/exercises/forth/cases_test.go +2 -2
- data/tracks/go/exercises/forth/example.go +0 -2
- data/tracks/go/exercises/forth/forth_test.go +0 -8
- data/tracks/go/exercises/gigasecond/cases_test.go +2 -2
- data/tracks/go/exercises/gigasecond/example.go +0 -2
- data/tracks/go/exercises/gigasecond/gigasecond.go +13 -3
- data/tracks/go/exercises/gigasecond/gigasecond_test.go +0 -8
- data/tracks/go/exercises/grade-school/example.go +0 -2
- data/tracks/go/exercises/grade-school/grade_school_test.go +0 -8
- data/tracks/go/exercises/grains/example.go +0 -2
- data/tracks/go/exercises/grains/grains_test.go +0 -8
- data/tracks/go/exercises/hamming/.meta/hints.md +4 -0
- data/tracks/go/exercises/hamming/README.md +6 -0
- data/tracks/go/exercises/hamming/example.go +0 -2
- data/tracks/go/exercises/hamming/hamming.go +0 -2
- data/tracks/go/exercises/hamming/hamming_test.go +0 -8
- data/tracks/go/exercises/hello-world/hello_world.go +9 -1
- data/tracks/go/exercises/hexadecimal/example.go +0 -2
- data/tracks/go/exercises/hexadecimal/hexadecimal_test.go +0 -8
- data/tracks/go/exercises/house/example.go +0 -2
- data/tracks/go/exercises/house/house_test.go +0 -8
- data/tracks/go/exercises/isbn-verifier/README.md +60 -0
- data/tracks/go/exercises/isbn-verifier/example.go +57 -0
- data/tracks/go/exercises/isbn-verifier/isbn_verifier_test.go +35 -0
- data/tracks/go/exercises/isogram/example.go +0 -2
- data/tracks/go/exercises/isogram/isogram_test.go +0 -8
- data/tracks/go/exercises/kindergarten-garden/example.go +0 -2
- data/tracks/go/exercises/kindergarten-garden/kindergarten_garden_test.go +0 -8
- data/tracks/go/exercises/largest-series-product/cases_test.go +2 -2
- data/tracks/go/exercises/largest-series-product/example.go +0 -2
- data/tracks/go/exercises/largest-series-product/largest_series_product_test.go +0 -8
- data/tracks/go/exercises/leap/.meta/hints.md +14 -0
- data/tracks/go/exercises/leap/README.md +16 -0
- data/tracks/go/exercises/leap/cases_test.go +4 -4
- data/tracks/go/exercises/leap/example.go +0 -2
- data/tracks/go/exercises/leap/leap.go +11 -2
- data/tracks/go/exercises/leap/leap_test.go +0 -15
- data/tracks/go/exercises/ledger/example.go +0 -2
- data/tracks/go/exercises/ledger/ledger.go +0 -2
- data/tracks/go/exercises/ledger/ledger_test.go +0 -8
- data/tracks/go/exercises/luhn/cases_test.go +2 -2
- data/tracks/go/exercises/luhn/example.go +0 -2
- data/tracks/go/exercises/luhn/luhn_test.go +0 -8
- data/tracks/go/exercises/matrix/example.go +0 -2
- data/tracks/go/exercises/matrix/matrix_test.go +0 -8
- data/tracks/go/exercises/meetup/cases_test.go +2 -2
- data/tracks/go/exercises/meetup/example.go +0 -2
- data/tracks/go/exercises/meetup/meetup_test.go +0 -8
- data/tracks/go/exercises/minesweeper/example.go +0 -2
- data/tracks/go/exercises/minesweeper/minesweeper_test.go +0 -8
- data/tracks/go/exercises/nth-prime/example.go +0 -2
- data/tracks/go/exercises/nth-prime/nth_prime_test.go +0 -8
- data/tracks/go/exercises/nucleotide-count/example.go +0 -2
- data/tracks/go/exercises/nucleotide-count/nucleotide_count.go +26 -0
- data/tracks/go/exercises/nucleotide-count/nucleotide_count_test.go +0 -8
- data/tracks/go/exercises/ocr-numbers/example.go +0 -2
- data/tracks/go/exercises/ocr-numbers/ocr_numbers_test.go +0 -8
- data/tracks/go/exercises/octal/example.go +0 -2
- data/tracks/go/exercises/octal/octal_test.go +0 -8
- data/tracks/go/exercises/paasio/example.go +0 -2
- data/tracks/go/exercises/paasio/paasio_test.go +0 -8
- data/tracks/go/exercises/palindrome-products/example.go +0 -2
- data/tracks/go/exercises/palindrome-products/palindrome_products_test.go +0 -8
- data/tracks/go/exercises/pangram/example.go +0 -2
- data/tracks/go/exercises/pangram/pangram_test.go +2 -8
- data/tracks/go/exercises/parallel-letter-frequency/example.go +0 -2
- data/tracks/go/exercises/parallel-letter-frequency/parallel_letter_frequency_test.go +0 -8
- data/tracks/go/exercises/pascals-triangle/example.go +0 -2
- data/tracks/go/exercises/pascals-triangle/pascals_triangle_test.go +0 -8
- data/tracks/go/exercises/perfect-numbers/example.go +0 -2
- data/tracks/go/exercises/perfect-numbers/perfect_numbers_test.go +0 -8
- data/tracks/go/exercises/phone-number/cases_test.go +2 -2
- data/tracks/go/exercises/phone-number/example.go +0 -2
- data/tracks/go/exercises/phone-number/phone_number_test.go +0 -8
- data/tracks/go/exercises/pig-latin/example.go +0 -2
- data/tracks/go/exercises/pig-latin/pig_latin_test.go +0 -8
- data/tracks/go/exercises/poker/.meta/hints.md +7 -0
- data/tracks/go/exercises/poker/README.md +9 -0
- data/tracks/go/exercises/poker/cases_test.go +2 -2
- data/tracks/go/exercises/poker/example.go +0 -2
- data/tracks/go/exercises/poker/poker_test.go +0 -11
- data/tracks/go/exercises/pov/example.go +0 -2
- data/tracks/go/exercises/pov/pov_test.go +1 -9
- data/tracks/go/exercises/prime-factors/example.go +0 -2
- data/tracks/go/exercises/prime-factors/prime_factors_test.go +1 -9
- data/tracks/go/exercises/protein-translation/example.go +0 -2
- data/tracks/go/exercises/protein-translation/protein_translation_test.go +0 -8
- data/tracks/go/exercises/pythagorean-triplet/example.go +0 -2
- data/tracks/go/exercises/pythagorean-triplet/pythagorean_triplet_test.go +0 -8
- data/tracks/go/exercises/queen-attack/example.go +0 -2
- data/tracks/go/exercises/queen-attack/queen_attack_test.go +0 -8
- data/tracks/go/exercises/raindrops/.meta/hints.md +7 -0
- data/tracks/go/exercises/raindrops/cases_test.go +2 -2
- data/tracks/go/exercises/raindrops/example.go +0 -2
- data/tracks/go/exercises/raindrops/raindrops_test.go +0 -8
- data/tracks/go/exercises/react/example.go +0 -2
- data/tracks/go/exercises/react/react_test.go +0 -11
- data/tracks/go/exercises/rna-transcription/cases_test.go +2 -2
- data/tracks/go/exercises/rna-transcription/example.go +0 -2
- data/tracks/go/exercises/rna-transcription/rna_transcription.go +6 -0
- data/tracks/go/exercises/rna-transcription/rna_transcription_test.go +0 -8
- data/tracks/go/exercises/robot-name/example.go +0 -2
- data/tracks/go/exercises/robot-name/robot_name_test.go +0 -8
- data/tracks/go/exercises/robot-simulator/example.go +0 -1
- data/tracks/go/exercises/robot-simulator/robot_simulator_test.go +0 -8
- data/tracks/go/exercises/roman-numerals/cases_test.go +2 -2
- data/tracks/go/exercises/roman-numerals/example.go +0 -2
- data/tracks/go/exercises/roman-numerals/roman_numerals_test.go +0 -8
- data/tracks/go/exercises/rotational-cipher/README.md +56 -0
- data/tracks/go/exercises/rotational-cipher/example.go +20 -0
- data/tracks/go/exercises/rotational-cipher/rotational_cipher_test.go +86 -0
- data/tracks/go/exercises/run-length-encoding/README.md +31 -0
- data/tracks/go/exercises/run-length-encoding/example.go +53 -0
- data/tracks/go/exercises/run-length-encoding/run_length_encoding_test.go +59 -0
- data/tracks/go/exercises/saddle-points/example.go +0 -2
- data/tracks/go/exercises/saddle-points/saddle_points_test.go +0 -8
- data/tracks/go/exercises/say/.meta/gen.go +70 -0
- data/tracks/go/exercises/say/cases_test.go +88 -0
- data/tracks/go/exercises/say/example.go +12 -6
- data/tracks/go/exercises/say/say_test.go +17 -43
- data/tracks/go/exercises/scrabble-score/cases_test.go +2 -2
- data/tracks/go/exercises/scrabble-score/example.go +0 -3
- data/tracks/go/exercises/scrabble-score/scrabble_score_test.go +0 -8
- data/tracks/go/exercises/secret-handshake/cases_test.go +2 -2
- data/tracks/go/exercises/secret-handshake/example.go +0 -2
- data/tracks/go/exercises/secret-handshake/secret_handshake_test.go +0 -8
- data/tracks/go/exercises/series/example.go +0 -2
- data/tracks/go/exercises/series/series_test.go +0 -8
- data/tracks/go/exercises/sieve/example.go +0 -2
- data/tracks/go/exercises/sieve/sieve_test.go +0 -8
- data/tracks/go/exercises/simple-cipher/example.go +0 -2
- data/tracks/go/exercises/simple-cipher/simple_cipher_test.go +0 -8
- data/tracks/go/exercises/space-age/.meta/gen.go +56 -0
- data/tracks/go/exercises/space-age/README.md +42 -0
- data/tracks/go/exercises/space-age/cases_test.go +61 -0
- data/tracks/go/exercises/space-age/example.go +36 -0
- data/tracks/go/exercises/space-age/space_age_test.go +22 -0
- data/tracks/go/exercises/spiral-matrix/README.md +48 -0
- data/tracks/go/exercises/spiral-matrix/example.go +93 -0
- data/tracks/go/exercises/spiral-matrix/spiral_matrix_test.go +71 -0
- data/tracks/go/exercises/strain/example.go +0 -2
- data/tracks/go/exercises/strain/strain_test.go +0 -8
- data/tracks/go/exercises/sublist/.meta/gen.go +56 -0
- data/tracks/go/exercises/sublist/README.md +39 -0
- data/tracks/go/exercises/sublist/cases_test.go +115 -0
- data/tracks/go/exercises/sublist/example.go +49 -0
- data/tracks/go/exercises/sublist/sublist_test.go +22 -0
- data/tracks/go/exercises/sum-of-multiples/cases_test.go +4 -3
- data/tracks/go/exercises/sum-of-multiples/example.go +0 -2
- data/tracks/go/exercises/sum-of-multiples/sum_of_multiples_test.go +0 -8
- data/tracks/go/exercises/tournament/example.go +0 -2
- data/tracks/go/exercises/tournament/tournament_test.go +0 -11
- data/tracks/go/exercises/transpose/cases_test.go +2 -2
- data/tracks/go/exercises/transpose/example.go +0 -2
- data/tracks/go/exercises/transpose/transpose_test.go +0 -8
- data/tracks/go/exercises/tree-building/example.go +0 -2
- data/tracks/go/exercises/tree-building/tree_building.go +0 -2
- data/tracks/go/exercises/tree-building/tree_test.go +0 -11
- data/tracks/go/exercises/triangle/.meta/hints.md +10 -0
- data/tracks/go/exercises/triangle/example.go +0 -2
- data/tracks/go/exercises/triangle/triangle.go +21 -9
- data/tracks/go/exercises/triangle/triangle_test.go +0 -8
- data/tracks/go/exercises/trinary/example.go +0 -2
- data/tracks/go/exercises/trinary/trinary_test.go +0 -8
- data/tracks/go/exercises/twelve-days/example.go +0 -2
- data/tracks/go/exercises/twelve-days/twelve_days_test.go +0 -8
- data/tracks/go/exercises/two-fer/two_fer.go +2 -2
- data/tracks/go/exercises/variable-length-quantity/cases_test.go +2 -2
- data/tracks/go/exercises/variable-length-quantity/example.go +0 -2
- data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +0 -8
- data/tracks/go/exercises/word-count/cases_test.go +2 -2
- data/tracks/go/exercises/word-count/example.go +0 -2
- data/tracks/go/exercises/word-count/word_count_test.go +4 -7
- data/tracks/go/exercises/word-search/.meta/gen.go +96 -0
- data/tracks/go/exercises/word-search/cases_test.go +154 -0
- data/tracks/go/exercises/word-search/example.go +0 -2
- data/tracks/go/exercises/word-search/word_search_test.go +16 -52
- data/tracks/go/exercises/wordy/example.go +0 -2
- data/tracks/go/exercises/wordy/wordy_test.go +0 -8
- data/tracks/go/gen/gen.go +4 -1
- data/tracks/java/exercises/phone-number/README.md +1 -1
- data/tracks/kotlin/exercises/phone-number/README.md +1 -1
- data/tracks/perl6/config.json +50 -0
- data/tracks/perl6/exercises/etl/ETL.pm6 +6 -0
- data/tracks/perl6/exercises/etl/Example.pm6 +7 -0
- data/tracks/perl6/exercises/etl/README.md +72 -0
- data/tracks/perl6/exercises/etl/etl.t +139 -0
- data/tracks/perl6/exercises/etl/example.yaml +35 -0
- data/tracks/perl6/exercises/hamming/Example.pm6 +6 -0
- data/tracks/perl6/exercises/hamming/Hamming.pm6 +4 -0
- data/tracks/perl6/exercises/hamming/README.md +61 -0
- data/tracks/perl6/exercises/hamming/example.yaml +22 -0
- data/tracks/perl6/exercises/hamming/hamming.t +175 -0
- data/tracks/perl6/exercises/meetup/Example.pm6 +37 -0
- data/tracks/perl6/exercises/meetup/Meetup.pm6 +4 -0
- data/tracks/perl6/exercises/meetup/README.md +48 -0
- data/tracks/perl6/exercises/meetup/example.yaml +48 -0
- data/tracks/perl6/exercises/meetup/meetup.t +907 -0
- data/tracks/perl6/exercises/pangram/Example.pm6 +5 -0
- data/tracks/perl6/exercises/pangram/Pangram.pm6 +4 -0
- data/tracks/perl6/exercises/pangram/README.md +34 -0
- data/tracks/perl6/exercises/pangram/example.yaml +17 -0
- data/tracks/perl6/exercises/pangram/pangram.t +125 -0
- data/tracks/perl6/exercises/phone-number/README.md +1 -1
- data/tracks/perl6/exercises/two-fer/Example.pm6 +14 -0
- data/tracks/perl6/exercises/two-fer/README.md +38 -0
- data/tracks/perl6/exercises/two-fer/TwoFer.pm6 +15 -0
- data/tracks/perl6/exercises/two-fer/example.yaml +43 -0
- data/tracks/perl6/exercises/two-fer/two-fer.t +82 -0
- data/tracks/php/config.json +13 -0
- data/tracks/php/exercises/rail-fence-cipher/README.md +80 -0
- data/tracks/php/exercises/rail-fence-cipher/example.php +61 -0
- data/tracks/php/exercises/rail-fence-cipher/rail-fence-cipher_test.php +76 -0
- data/tracks/purescript/.travis.yml +1 -1
- data/tracks/python/config.json +13 -0
- data/tracks/python/exercises/alphametics/example.py +42 -29
- data/tracks/python/exercises/crypto-square/crypto_square_test.py +20 -13
- data/tracks/python/exercises/crypto-square/example.py +1 -1
- data/tracks/python/exercises/kindergarten-garden/kindergarten_garden_test.py +15 -2
- data/tracks/python/exercises/phone-number/README.md +2 -1
- data/tracks/python/exercises/pov/README.md +53 -0
- data/tracks/python/exercises/pov/example.py +70 -0
- data/tracks/python/exercises/pov/pov.py +25 -0
- data/tracks/python/exercises/pov/pov_test.py +200 -0
- data/tracks/python/test/check-exercises.py +11 -1
- data/tracks/ruby/exercises/meetup/.meta/.version +1 -0
- data/tracks/ruby/exercises/meetup/.meta/generator/meetup_case.rb +11 -0
- data/tracks/ruby/exercises/meetup/.meta/solutions/meetup.rb +5 -0
- data/tracks/ruby/exercises/meetup/meetup_test.rb +48 -4
- metadata +90 -8
- data/tracks/go/exercises/accumulate/accumulate.go +0 -5
- data/tracks/go/exercises/clock/clock.go +0 -19
- data/tracks/go/exercises/pangram/pangram.go +0 -5
- data/tracks/go/exercises/raindrops/raindrops.go +0 -8
- data/tracks/go/exercises/twelve-days/HINTS.md +0 -2
- data/tracks/go/exercises/word-count/word_count.go +0 -9
@@ -51,9 +51,9 @@
|
|
51
51
|
"show_on_website": false
|
52
52
|
},
|
53
53
|
{
|
54
|
-
"alumnus":
|
54
|
+
"alumnus": true,
|
55
55
|
"avatar_url": null,
|
56
|
-
"bio": "I used to be an artist, and am now a software engineer, using Go
|
56
|
+
"bio": "I used to be an artist, and am now a software engineer, using Go for forensics monitoring. Exercism's Go track opened up the world of open source to me.",
|
57
57
|
"github_username": "robphoenix",
|
58
58
|
"link_text": "robphoenix.com",
|
59
59
|
"link_url": "https://blog.robphoenix.com/",
|
data/tracks/go/docs/TESTS.md
CHANGED
@@ -9,21 +9,6 @@ $ go test
|
|
9
9
|
|
10
10
|
Most exercises contain benchmarks, that you can use to determine how changes to your solution affect its performance. To run the benchmarks for an exercise use the command `go test -bench .` inside the exercise directory.
|
11
11
|
|
12
|
-
### The `testVersion` constant
|
13
|
-
|
14
|
-
Some exercises require you to define a testVersion constant in your package.
|
15
|
-
There are sometimes problems where tests change and solutions which worked for
|
16
|
-
the old version no longer work. The testVersion system makes it obvious when
|
17
|
-
this happens.
|
18
|
-
|
19
|
-
To avoid compilation warnings due to testVersion not being defined
|
20
|
-
just add `const testVersion = VERSION` (where VERSION should be replaced by the
|
21
|
-
value of `targetTestVersion` in the test file) to your submission file.
|
22
|
-
|
23
|
-
Should the tests change in a way that old submissions will or could no longer
|
24
|
-
work the test writer should increase the `targetTestVersion` value which will cause
|
25
|
-
the tests to fail with a clear message when an old submission is run with them.
|
26
|
-
|
27
12
|
### Testable examples
|
28
13
|
|
29
14
|
[Example tests](https://blog.golang.org/examples) are used in some exercises and
|
@@ -6,8 +6,6 @@ import (
|
|
6
6
|
"testing"
|
7
7
|
)
|
8
8
|
|
9
|
-
const targetTestVersion = 1
|
10
|
-
|
11
9
|
func echo(c string) string {
|
12
10
|
return c
|
13
11
|
}
|
@@ -28,12 +26,6 @@ var tests = []struct {
|
|
28
26
|
{[]string{"HELLO", "WORLD"}, []string{"hello", "world"}, strings.ToUpper, "strings.ToUpper"},
|
29
27
|
}
|
30
28
|
|
31
|
-
func TestTestVersion(t *testing.T) {
|
32
|
-
if testVersion != targetTestVersion {
|
33
|
-
t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
|
34
|
-
}
|
35
|
-
}
|
36
|
-
|
37
29
|
func TestAccumulate(t *testing.T) {
|
38
30
|
for _, test := range tests {
|
39
31
|
actual := Accumulate(test.given, test.converter)
|
@@ -1,5 +1,17 @@
|
|
1
|
-
|
1
|
+
// This is a "stub" file. It's a little start on your solution.
|
2
|
+
// It's not a complete solution though; you have to write some code.
|
2
3
|
|
3
|
-
|
4
|
+
// Package acronym should have a package comment that summarizes what it's about.
|
5
|
+
// https://golang.org/doc/effective_go.html#commentary
|
6
|
+
package acronym
|
4
7
|
|
5
8
|
func Abbreviate(string) string
|
9
|
+
|
10
|
+
// Abbreviate should have a comment documenting it.
|
11
|
+
func Abbreviate(s string) string {
|
12
|
+
// Write some code here to pass the test suite.
|
13
|
+
// Then remove all the stock comments.
|
14
|
+
// They're here to help you get started but they only clutter a finished solution.
|
15
|
+
// If you leave them in, reviewers may protest!
|
16
|
+
return ""
|
17
|
+
}
|
@@ -4,14 +4,6 @@ import (
|
|
4
4
|
"testing"
|
5
5
|
)
|
6
6
|
|
7
|
-
const targetTestVersion = 3
|
8
|
-
|
9
|
-
func TestTestVersion(t *testing.T) {
|
10
|
-
if testVersion != targetTestVersion {
|
11
|
-
t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
7
|
func TestAcronym(t *testing.T) {
|
16
8
|
for _, test := range stringTestCases {
|
17
9
|
actual := Abbreviate(test.input)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
package acronym
|
2
2
|
|
3
|
-
// Source: exercism/
|
3
|
+
// Source: exercism/problem-specifications
|
4
4
|
// Commit: cae7ae1 acronym: remove test case with mixed-case phrase (#788)
|
5
|
-
//
|
5
|
+
// Problem Specifications Version: 1.1.0
|
6
6
|
|
7
7
|
type acronymTest struct {
|
8
8
|
input string
|
@@ -2,8 +2,6 @@ package allyourbase
|
|
2
2
|
|
3
3
|
import "testing"
|
4
4
|
|
5
|
-
const targetTestVersion = 1
|
6
|
-
|
7
5
|
// Note: ConvertToBase should accept leading zeroes in its input,
|
8
6
|
// but never emit leading zeroes in its output.
|
9
7
|
// Exception: If the value of the output is zero, represent it with a single zero.
|
@@ -156,12 +154,6 @@ func digitsEqual(a, b []uint64) bool {
|
|
156
154
|
return true
|
157
155
|
}
|
158
156
|
|
159
|
-
func TestTestVersion(t *testing.T) {
|
160
|
-
if testVersion != targetTestVersion {
|
161
|
-
t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
157
|
func TestConvertToBase(t *testing.T) {
|
166
158
|
for _, c := range testCases {
|
167
159
|
output, err := ConvertToBase(c.inputBase, c.inputDigits, c.outputBase)
|
@@ -6,8 +6,6 @@ import (
|
|
6
6
|
"testing"
|
7
7
|
)
|
8
8
|
|
9
|
-
const targetTestVersion = 1
|
10
|
-
|
11
9
|
var allergiesTests = []struct {
|
12
10
|
expected []string
|
13
11
|
input uint
|
@@ -23,12 +21,6 @@ var allergiesTests = []struct {
|
|
23
21
|
{[]string{"eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"}, 509},
|
24
22
|
}
|
25
23
|
|
26
|
-
func TestTestVersion(t *testing.T) {
|
27
|
-
if testVersion != targetTestVersion {
|
28
|
-
t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
|
29
|
-
}
|
30
|
-
}
|
31
|
-
|
32
24
|
func TestAllergies(t *testing.T) {
|
33
25
|
for _, test := range allergiesTests {
|
34
26
|
actual := Allergies(test.input)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
"log"
|
5
|
+
"text/template"
|
6
|
+
|
7
|
+
"../../../gen"
|
8
|
+
)
|
9
|
+
|
10
|
+
func main() {
|
11
|
+
t, err := template.New("").Parse(tmpl)
|
12
|
+
if err != nil {
|
13
|
+
log.Fatal(err)
|
14
|
+
}
|
15
|
+
var j js
|
16
|
+
if err := gen.Gen("anagram", &j, t); err != nil {
|
17
|
+
log.Fatal(err)
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
// The JSON structure we expect to be able to unmarshal into
|
22
|
+
type js struct {
|
23
|
+
Exercise string
|
24
|
+
Version string
|
25
|
+
Comments []string
|
26
|
+
Cases []OneCase
|
27
|
+
}
|
28
|
+
|
29
|
+
// The JSON structure we expect to be able to unmarshal into
|
30
|
+
type OneCase struct {
|
31
|
+
Description string
|
32
|
+
Subject string
|
33
|
+
Candidates []string
|
34
|
+
Expected []string
|
35
|
+
}
|
36
|
+
|
37
|
+
// template applied to above data structure generates the Go test cases
|
38
|
+
var tmpl = `package anagram
|
39
|
+
|
40
|
+
{{.Header}}
|
41
|
+
|
42
|
+
var testCases = []struct {
|
43
|
+
description string
|
44
|
+
subject string
|
45
|
+
candidates []string
|
46
|
+
expected []string
|
47
|
+
}{ {{range .J.Cases}}
|
48
|
+
{
|
49
|
+
description: {{printf "%q" .Description}},
|
50
|
+
subject: {{printf "%q" .Subject}},
|
51
|
+
candidates: []string { {{range $line := .Candidates}}{{printf "\n%q," $line}}{{end}}},
|
52
|
+
expected: []string { {{range $line := .Expected}}{{printf "\n%q," $line}}{{end}}},
|
53
|
+
},{{end}}
|
54
|
+
}
|
55
|
+
`
|
@@ -6,130 +6,6 @@ import (
|
|
6
6
|
"testing"
|
7
7
|
)
|
8
8
|
|
9
|
-
const targetTestVersion = 2
|
10
|
-
|
11
|
-
var testCases = []struct {
|
12
|
-
subject string
|
13
|
-
candidates []string
|
14
|
-
expected []string
|
15
|
-
description string
|
16
|
-
}{
|
17
|
-
{
|
18
|
-
subject: "diaper",
|
19
|
-
candidates: []string{
|
20
|
-
"hello",
|
21
|
-
"world",
|
22
|
-
"zombies",
|
23
|
-
"pants",
|
24
|
-
},
|
25
|
-
expected: []string{},
|
26
|
-
description: "no matches",
|
27
|
-
},
|
28
|
-
{
|
29
|
-
subject: "ant",
|
30
|
-
candidates: []string{
|
31
|
-
"tan",
|
32
|
-
"stand",
|
33
|
-
"at",
|
34
|
-
},
|
35
|
-
expected: []string{"tan"},
|
36
|
-
description: "simple anagram",
|
37
|
-
},
|
38
|
-
{
|
39
|
-
subject: "listen",
|
40
|
-
candidates: []string{
|
41
|
-
"enlists",
|
42
|
-
"google",
|
43
|
-
"inlets",
|
44
|
-
"banana",
|
45
|
-
},
|
46
|
-
expected: []string{"inlets"},
|
47
|
-
description: "another simple anagram",
|
48
|
-
},
|
49
|
-
{
|
50
|
-
subject: "master",
|
51
|
-
candidates: []string{
|
52
|
-
"stream",
|
53
|
-
"pigeon",
|
54
|
-
"maters",
|
55
|
-
},
|
56
|
-
expected: []string{"maters", "stream"},
|
57
|
-
description: "multiple anagrams",
|
58
|
-
},
|
59
|
-
{
|
60
|
-
subject: "allergy",
|
61
|
-
candidates: []string{
|
62
|
-
"gallery",
|
63
|
-
"ballerina",
|
64
|
-
"regally",
|
65
|
-
"clergy",
|
66
|
-
"largely",
|
67
|
-
"leading",
|
68
|
-
},
|
69
|
-
expected: []string{"gallery", "largely", "regally"},
|
70
|
-
description: "multiple anagrams (again)",
|
71
|
-
},
|
72
|
-
{
|
73
|
-
subject: "galea",
|
74
|
-
candidates: []string{
|
75
|
-
"eagle",
|
76
|
-
},
|
77
|
-
expected: []string{},
|
78
|
-
description: "does not confuse different duplicates",
|
79
|
-
},
|
80
|
-
{
|
81
|
-
subject: "corn",
|
82
|
-
candidates: []string{
|
83
|
-
"corn",
|
84
|
-
"dark",
|
85
|
-
"Corn",
|
86
|
-
"rank",
|
87
|
-
"CORN",
|
88
|
-
"cron",
|
89
|
-
"park",
|
90
|
-
},
|
91
|
-
expected: []string{"cron"},
|
92
|
-
description: "identical word is not anagram",
|
93
|
-
},
|
94
|
-
{
|
95
|
-
subject: "mass",
|
96
|
-
candidates: []string{
|
97
|
-
"last",
|
98
|
-
},
|
99
|
-
expected: []string{},
|
100
|
-
description: "eliminate anagrams with same checksum",
|
101
|
-
},
|
102
|
-
{
|
103
|
-
subject: "good",
|
104
|
-
candidates: []string{
|
105
|
-
"dog",
|
106
|
-
"goody",
|
107
|
-
},
|
108
|
-
expected: []string{},
|
109
|
-
description: "eliminate anagram subsets",
|
110
|
-
},
|
111
|
-
{
|
112
|
-
subject: "Orchestra",
|
113
|
-
candidates: []string{
|
114
|
-
"cashregiser",
|
115
|
-
"carthorse",
|
116
|
-
"radishes",
|
117
|
-
},
|
118
|
-
expected: []string{"carthorse"},
|
119
|
-
description: "subjects are case insensitive",
|
120
|
-
},
|
121
|
-
{
|
122
|
-
subject: "orchestra",
|
123
|
-
candidates: []string{
|
124
|
-
"cashregiser",
|
125
|
-
"Carthorse",
|
126
|
-
"radishes",
|
127
|
-
},
|
128
|
-
expected: []string{"Carthorse"},
|
129
|
-
description: "candidates are case insensitive",
|
130
|
-
},
|
131
|
-
}
|
132
|
-
|
133
9
|
func equal(a []string, b []string) bool {
|
134
10
|
if len(b) != len(a) {
|
135
11
|
return false
|
@@ -140,12 +16,6 @@ func equal(a []string, b []string) bool {
|
|
140
16
|
return fmt.Sprintf("%v", a) == fmt.Sprintf("%v", b)
|
141
17
|
}
|
142
18
|
|
143
|
-
func TestTestVersion(t *testing.T) {
|
144
|
-
if testVersion != targetTestVersion {
|
145
|
-
t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
|
146
|
-
}
|
147
|
-
}
|
148
|
-
|
149
19
|
func TestDetectAnagrams(t *testing.T) {
|
150
20
|
for _, tt := range testCases {
|
151
21
|
actual := Detect(tt.subject, tt.candidates)
|
@@ -0,0 +1,164 @@
|
|
1
|
+
package anagram
|
2
|
+
|
3
|
+
// Source: exercism/problem-specifications
|
4
|
+
// Commit: 196fc1a anagram: Rename duplicated test case description (#671)
|
5
|
+
// Problem Specifications Version: 1.0.1
|
6
|
+
|
7
|
+
var testCases = []struct {
|
8
|
+
description string
|
9
|
+
subject string
|
10
|
+
candidates []string
|
11
|
+
expected []string
|
12
|
+
}{
|
13
|
+
{
|
14
|
+
description: "no matches",
|
15
|
+
subject: "diaper",
|
16
|
+
candidates: []string{
|
17
|
+
"hello",
|
18
|
+
"world",
|
19
|
+
"zombies",
|
20
|
+
"pants"},
|
21
|
+
expected: []string{},
|
22
|
+
},
|
23
|
+
{
|
24
|
+
description: "detects simple anagram",
|
25
|
+
subject: "ant",
|
26
|
+
candidates: []string{
|
27
|
+
"tan",
|
28
|
+
"stand",
|
29
|
+
"at"},
|
30
|
+
expected: []string{
|
31
|
+
"tan"},
|
32
|
+
},
|
33
|
+
{
|
34
|
+
description: "does not detect false positives",
|
35
|
+
subject: "galea",
|
36
|
+
candidates: []string{
|
37
|
+
"eagle"},
|
38
|
+
expected: []string{},
|
39
|
+
},
|
40
|
+
{
|
41
|
+
description: "detects two anagrams",
|
42
|
+
subject: "master",
|
43
|
+
candidates: []string{
|
44
|
+
"stream",
|
45
|
+
"pigeon",
|
46
|
+
"maters"},
|
47
|
+
expected: []string{
|
48
|
+
"stream",
|
49
|
+
"maters"},
|
50
|
+
},
|
51
|
+
{
|
52
|
+
description: "does not detect anagram subsets",
|
53
|
+
subject: "good",
|
54
|
+
candidates: []string{
|
55
|
+
"dog",
|
56
|
+
"goody"},
|
57
|
+
expected: []string{},
|
58
|
+
},
|
59
|
+
{
|
60
|
+
description: "detects anagram",
|
61
|
+
subject: "listen",
|
62
|
+
candidates: []string{
|
63
|
+
"enlists",
|
64
|
+
"google",
|
65
|
+
"inlets",
|
66
|
+
"banana"},
|
67
|
+
expected: []string{
|
68
|
+
"inlets"},
|
69
|
+
},
|
70
|
+
{
|
71
|
+
description: "detects three anagrams",
|
72
|
+
subject: "allergy",
|
73
|
+
candidates: []string{
|
74
|
+
"gallery",
|
75
|
+
"ballerina",
|
76
|
+
"regally",
|
77
|
+
"clergy",
|
78
|
+
"largely",
|
79
|
+
"leading"},
|
80
|
+
expected: []string{
|
81
|
+
"gallery",
|
82
|
+
"regally",
|
83
|
+
"largely"},
|
84
|
+
},
|
85
|
+
{
|
86
|
+
description: "does not detect identical words",
|
87
|
+
subject: "corn",
|
88
|
+
candidates: []string{
|
89
|
+
"corn",
|
90
|
+
"dark",
|
91
|
+
"Corn",
|
92
|
+
"rank",
|
93
|
+
"CORN",
|
94
|
+
"cron",
|
95
|
+
"park"},
|
96
|
+
expected: []string{
|
97
|
+
"cron"},
|
98
|
+
},
|
99
|
+
{
|
100
|
+
description: "does not detect non-anagrams with identical checksum",
|
101
|
+
subject: "mass",
|
102
|
+
candidates: []string{
|
103
|
+
"last"},
|
104
|
+
expected: []string{},
|
105
|
+
},
|
106
|
+
{
|
107
|
+
description: "detects anagrams case-insensitively",
|
108
|
+
subject: "Orchestra",
|
109
|
+
candidates: []string{
|
110
|
+
"cashregister",
|
111
|
+
"Carthorse",
|
112
|
+
"radishes"},
|
113
|
+
expected: []string{
|
114
|
+
"Carthorse"},
|
115
|
+
},
|
116
|
+
{
|
117
|
+
description: "detects anagrams using case-insensitive subject",
|
118
|
+
subject: "Orchestra",
|
119
|
+
candidates: []string{
|
120
|
+
"cashregister",
|
121
|
+
"carthorse",
|
122
|
+
"radishes"},
|
123
|
+
expected: []string{
|
124
|
+
"carthorse"},
|
125
|
+
},
|
126
|
+
{
|
127
|
+
description: "detects anagrams using case-insensitive possible matches",
|
128
|
+
subject: "orchestra",
|
129
|
+
candidates: []string{
|
130
|
+
"cashregister",
|
131
|
+
"Carthorse",
|
132
|
+
"radishes"},
|
133
|
+
expected: []string{
|
134
|
+
"Carthorse"},
|
135
|
+
},
|
136
|
+
{
|
137
|
+
description: "does not detect a word as its own anagram",
|
138
|
+
subject: "banana",
|
139
|
+
candidates: []string{
|
140
|
+
"Banana"},
|
141
|
+
expected: []string{},
|
142
|
+
},
|
143
|
+
{
|
144
|
+
description: "does not detect a anagram if the original word is repeated",
|
145
|
+
subject: "go",
|
146
|
+
candidates: []string{
|
147
|
+
"go Go GO"},
|
148
|
+
expected: []string{},
|
149
|
+
},
|
150
|
+
{
|
151
|
+
description: "anagrams must use all letters exactly once",
|
152
|
+
subject: "tapper",
|
153
|
+
candidates: []string{
|
154
|
+
"patter"},
|
155
|
+
expected: []string{},
|
156
|
+
},
|
157
|
+
{
|
158
|
+
description: "capital word is not own anagram",
|
159
|
+
subject: "BANANA",
|
160
|
+
candidates: []string{
|
161
|
+
"Banana"},
|
162
|
+
expected: []string{},
|
163
|
+
},
|
164
|
+
}
|