diff --git a/exercises/practice/bob/.meta/tests.toml b/exercises/practice/bob/.meta/tests.toml index 5299e2895f..c6a4649601 100644 --- a/exercises/practice/bob/.meta/tests.toml +++ b/exercises/practice/bob/.meta/tests.toml @@ -9,17 +9,20 @@ # As user-added comments (using the # character) will be removed when this file # is regenerated, comments can be added via a `comment` key. -[e162fead-606f-437a-a166-d051915cea8e] -description = "stating something" +[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] +description = "asking a question" [73a966dc-8017-47d6-bb32-cf07d1a5fcd9] description = "shouting" -[d6c98afd-df35-4806-b55e-2c457c3ab748] -description = "shouting gibberish" +[a5193c61-4a92-4f68-93e2-f554eb385ec6] +description = "forceful question" -[8a2e771d-d6f1-4e3f-b6c6-b41495556e37] -description = "asking a question" +[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] +description = "silence" + +[e162fead-606f-437a-a166-d051915cea8e] +description = "stating something" [81080c62-4e4d-4066-b30a-48d8d76920d9] description = "asking a numeric question" @@ -27,23 +30,34 @@ description = "asking a numeric question" [2a02716d-685b-4e2e-a804-2adaf281c01e] description = "asking gibberish" -[c02f9179-ab16-4aa7-a8dc-940145c385f7] -description = "talking forcefully" +[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] +description = "question with no letters" -[153c0e25-9bb5-4ec5-966e-598463658bcd] -description = "using acronyms in regular speech" +[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] +description = "non-letters with question" -[a5193c61-4a92-4f68-93e2-f554eb385ec6] -description = "forceful question" +[8608c508-f7de-4b17-985b-811878b3cf45] +description = "prattling on" -[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] -description = "shouting numbers" +[05b304d6-f83b-46e7-81e0-4cd3ca647900] +description = "ending with whitespace" -[f7bc4b92-bdff-421e-a238-ae97f230ccac] -description = "no letters" +[66953780-165b-4e7e-8ce3-4bcb80b6385a] +description = "multiple line question" +include = false -[bb0011c5-cd52-4a5b-8bfb-a87b6283b0e2] -description = "question with no letters" +[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] +description = "multiple line question" +reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" + +[d6c98afd-df35-4806-b55e-2c457c3ab748] +description = "shouting gibberish" + +[3c954328-86fb-4c71-8961-e18d6a5e2517] +description = "shouting a statement containing a question mark" + +[a20e0c54-2224-4dde-8b10-bd2cdd4f61bc] +description = "shouting numbers" [496143c8-1c31-4c01-8a08-88427af85c66] description = "shouting with special characters" @@ -51,40 +65,29 @@ description = "shouting with special characters" [e6793c1c-43bd-4b8d-bc11-499aea73925f] description = "shouting with no exclamation mark" -[aa8097cc-c548-4951-8856-14a404dd236a] -description = "statement containing question mark" - -[9bfc677d-ea3a-45f2-be44-35bc8fa3753e] -description = "non-letters with question" - -[8608c508-f7de-4b17-985b-811878b3cf45] -description = "prattling on" - -[bc39f7c6-f543-41be-9a43-fd1c2f753fc0] -description = "silence" - [d6c47565-372b-4b09-b1dd-c40552b8378b] description = "prolonged silence" [4428f28d-4100-4d85-a902-e5a78cb0ecd3] description = "alternate silence" -[66953780-165b-4e7e-8ce3-4bcb80b6385a] -description = "multiple line question" -include = false +[72bd5ad3-9b2f-4931-a988-dce1f5771de2] +description = "other whitespace" -[5371ef75-d9ea-4103-bcfa-2da973ddec1b] -description = "starting with whitespace" +[c02f9179-ab16-4aa7-a8dc-940145c385f7] +description = "talking forcefully" -[05b304d6-f83b-46e7-81e0-4cd3ca647900] -description = "ending with whitespace" +[153c0e25-9bb5-4ec5-966e-598463658bcd] +description = "using acronyms in regular speech" -[72bd5ad3-9b2f-4931-a988-dce1f5771de2] -description = "other whitespace" +[f7bc4b92-bdff-421e-a238-ae97f230ccac] +description = "no letters" + +[aa8097cc-c548-4951-8856-14a404dd236a] +description = "statement containing question mark" + +[5371ef75-d9ea-4103-bcfa-2da973ddec1b] +description = "starting with whitespace" [12983553-8601-46a8-92fa-fcaa3bc4a2a0] description = "non-question ending with whitespace" - -[2c7278ac-f955-4eb4-bf8f-e33eb4116a15] -description = "multiple line question" -reimplements = "66953780-165b-4e7e-8ce3-4bcb80b6385a" diff --git a/exercises/practice/bob/bob_test.rb b/exercises/practice/bob/bob_test.rb index 87e0b8c817..bbcc32942f 100644 --- a/exercises/practice/bob/bob_test.rb +++ b/exercises/practice/bob/bob_test.rb @@ -2,10 +2,10 @@ require_relative 'bob' class BobTest < Minitest::Test - def test_stating_something + def test_asking_a_question # skip - remark = "Tom-ay-to, tom-aaaah-to." - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Tom-ay-to, tom-aaaah-to.\", and.." + remark = "Does this cryogenic chamber make me look fat?" + assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Does this cryogenic chamber make me look fat?\", and.." end def test_shouting @@ -14,16 +14,22 @@ def test_shouting assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"WATCH OUT!\", and.." end - def test_shouting_gibberish + def test_forceful_question skip - remark = "FCECDFCAAB" - assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"FCECDFCAAB\", and.." + remark = "WHAT'S GOING ON?" + assert_equal "Calm down, I know what I'm doing!", Bob.hey(remark), "Bob hears \"WHAT'S GOING ON?\", and.." end - def test_asking_a_question + def test_silence skip - remark = "Does this cryogenic chamber make me look fat?" - assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Does this cryogenic chamber make me look fat?\", and.." + remark = "" + assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\", and.." + end + + def test_stating_something + skip + remark = "Tom-ay-to, tom-aaaah-to." + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Tom-ay-to, tom-aaaah-to.\", and.." end def test_asking_a_numeric_question @@ -38,40 +44,52 @@ def test_asking_gibberish assert_equal "Sure.", Bob.hey(remark), "Bob hears \"fffbbcbeab?\", and.." end - def test_talking_forcefully + def test_question_with_no_letters skip - remark = "Hi there!" - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Hi there!\", and.." + remark = "4?" + assert_equal "Sure.", Bob.hey(remark), "Bob hears \"4?\", and.." end - def test_using_acronyms_in_regular_speech + def test_non_letters_with_question skip - remark = "It's OK if you don't want to go work for NASA." - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"It's OK if you don't want to go work for NASA.\", and.." + remark = ":) ?" + assert_equal "Sure.", Bob.hey(remark), "Bob hears \":) ?\", and.." end - def test_forceful_question + def test_prattling_on skip - remark = "WHAT'S GOING ON?" - assert_equal "Calm down, I know what I'm doing!", Bob.hey(remark), "Bob hears \"WHAT'S GOING ON?\", and.." + remark = "Wait! Hang on. Are you going to be OK?" + assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Wait! Hang on. Are you going to be OK?\", and.." end - def test_shouting_numbers + def test_ending_with_whitespace skip - remark = "1, 2, 3 GO!" - assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"1, 2, 3 GO!\", and.." + remark = "Okay if like my spacebar quite a bit? " + assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Okay if like my spacebar quite a bit? \", and.." end - def test_no_letters + def test_multiple_line_question skip - remark = "1, 2, 3" - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"1, 2, 3\", and.." + remark = "\nDoes this cryogenic chamber make\n me look fat?" + assert_equal "Sure.", Bob.hey(remark), "Bob hears \"\\nDoes this cryogenic chamber make\\n me look fat?\", and.." end - def test_question_with_no_letters + def test_shouting_gibberish skip - remark = "4?" - assert_equal "Sure.", Bob.hey(remark), "Bob hears \"4?\", and.." + remark = "FCECDFCAAB" + assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"FCECDFCAAB\", and.." + end + + def test_shouting_a_statement_containing_a_question_mark + skip + remark = "DO LIONS EAT PEOPLE? AHHHHH." + assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"DO LIONS EAT PEOPLE? AHHHHH.\", and.." + end + + def test_shouting_numbers + skip + remark = "1, 2, 3 GO!" + assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"1, 2, 3 GO!\", and.." end def test_shouting_with_special_characters @@ -86,58 +104,52 @@ def test_shouting_with_no_exclamation_mark assert_equal "Whoa, chill out!", Bob.hey(remark), "Bob hears \"I HATE THE DENTIST\", and.." end - def test_statement_containing_question_mark - skip - remark = "Ending with ? means a question." - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Ending with ? means a question.\", and.." - end - - def test_non_letters_with_question + def test_prolonged_silence skip - remark = ":) ?" - assert_equal "Sure.", Bob.hey(remark), "Bob hears \":) ?\", and.." + remark = " " + assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \" \", and.." end - def test_prattling_on + def test_alternate_silence skip - remark = "Wait! Hang on. Are you going to be OK?" - assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Wait! Hang on. Are you going to be OK?\", and.." + remark = "\t\t\t\t\t\t\t\t\t\t" + assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\", and.." end - def test_silence + def test_other_whitespace skip - remark = "" - assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\", and.." + remark = "\n\r \t" + assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\\n\\r \\t\", and.." end - def test_prolonged_silence + def test_talking_forcefully skip - remark = " " - assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \" \", and.." + remark = "Hi there!" + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Hi there!\", and.." end - def test_alternate_silence + def test_using_acronyms_in_regular_speech skip - remark = "\t\t\t\t\t\t\t\t\t\t" - assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\", and.." + remark = "It's OK if you don't want to go work for NASA." + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"It's OK if you don't want to go work for NASA.\", and.." end - def test_starting_with_whitespace + def test_no_letters skip - remark = " hmmmmmmm..." - assert_equal "Whatever.", Bob.hey(remark), "Bob hears \" hmmmmmmm...\", and.." + remark = "1, 2, 3" + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"1, 2, 3\", and.." end - def test_ending_with_whitespace + def test_statement_containing_question_mark skip - remark = "Okay if like my spacebar quite a bit? " - assert_equal "Sure.", Bob.hey(remark), "Bob hears \"Okay if like my spacebar quite a bit? \", and.." + remark = "Ending with ? means a question." + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"Ending with ? means a question.\", and.." end - def test_other_whitespace + def test_starting_with_whitespace skip - remark = "\n\r \t" - assert_equal "Fine. Be that way!", Bob.hey(remark), "Bob hears \"\\n\\r \\t\", and.." + remark = " hmmmmmmm..." + assert_equal "Whatever.", Bob.hey(remark), "Bob hears \" hmmmmmmm...\", and.." end def test_non_question_ending_with_whitespace @@ -145,10 +157,4 @@ def test_non_question_ending_with_whitespace remark = "This is a statement ending with whitespace " assert_equal "Whatever.", Bob.hey(remark), "Bob hears \"This is a statement ending with whitespace \", and.." end - - def test_multiple_line_question - skip - remark = "\nDoes this cryogenic chamber make\n me look fat?" - assert_equal "Sure.", Bob.hey(remark), "Bob hears \"\\nDoes this cryogenic chamber make\\n me look fat?\", and.." - end end diff --git a/exercises/practice/connect/.meta/tests.toml b/exercises/practice/connect/.meta/tests.toml index 6ada87732c..951b87e5c4 100644 --- a/exercises/practice/connect/.meta/tests.toml +++ b/exercises/practice/connect/.meta/tests.toml @@ -30,6 +30,12 @@ description = "nobody wins crossing adjacent angles" [cd61c143-92f6-4a8d-84d9-cb2b359e226b] description = "X wins crossing from left to right" +[495e33ed-30a9-4012-b46e-d7c4d5fe13c3] +description = "X wins with left-hand dead end fork" + +[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58] +description = "X wins with right-hand dead end fork" + [73d1eda6-16ab-4460-9904-b5f5dd401d0b] description = "O wins crossing from top to bottom" diff --git a/exercises/practice/connect/connect_test.rb b/exercises/practice/connect/connect_test.rb index 0724c36d4d..3bc07949be 100644 --- a/exercises/practice/connect/connect_test.rb +++ b/exercises/practice/connect/connect_test.rb @@ -91,6 +91,32 @@ def test_x_wins_crossing_from_left_to_right assert_equal expected, actual, 'X wins crossing from left to right' end + def test_x_wins_with_left_hand_dead_end_fork + skip + expected = 'X' + board = [ + '. . X .', + ' X X . .', + ' . X X X', + ' O O O O' + ].map { |row| row.gsub(/^ */, '') } + actual = Board.new(board).winner + assert_equal expected, actual, 'X wins with left-hand dead end fork' + end + + def test_x_wins_with_right_hand_dead_end_fork + skip + expected = 'X' + board = [ + '. . X X', + ' X X . .', + ' . X X .', + ' O O O O' + ].map { |row| row.gsub(/^ */, '') } + actual = Board.new(board).winner + assert_equal expected, actual, 'X wins with right-hand dead end fork' + end + def test_o_wins_crossing_from_top_to_bottom skip expected = 'O' diff --git a/exercises/practice/flower-field/.meta/tests.toml b/exercises/practice/flower-field/.meta/tests.toml index c2b24fdaf5..965ba8fd4d 100644 --- a/exercises/practice/flower-field/.meta/tests.toml +++ b/exercises/practice/flower-field/.meta/tests.toml @@ -44,3 +44,6 @@ description = "cross" [dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8] description = "large garden" + +[6e4ac13a-3e43-4728-a2e3-3551d4b1a996] +description = "multiple adjacent flowers" diff --git a/exercises/practice/flower-field/flower_field_test.rb b/exercises/practice/flower-field/flower_field_test.rb index 23e1783030..715b0e3fa8 100644 --- a/exercises/practice/flower-field/flower_field_test.rb +++ b/exercises/practice/flower-field/flower_field_test.rb @@ -85,4 +85,11 @@ def test_large_garden expected = ["1*22*1", "12*322", " 123*2", "112*4*", "1*22*2", "111111"] assert_equal expected, FlowerField.annotate(input) end + + def test_multiple_adjacent_flowers + skip + input = [" ** "] + expected = ["1**1"] + assert_equal expected, FlowerField.annotate(input) + end end diff --git a/exercises/practice/isbn-verifier/.meta/tests.toml b/exercises/practice/isbn-verifier/.meta/tests.toml index 6d5a845990..17e18d47ac 100644 --- a/exercises/practice/isbn-verifier/.meta/tests.toml +++ b/exercises/practice/isbn-verifier/.meta/tests.toml @@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero" [28025280-2c39-4092-9719-f3234b89c627] description = "X is only valid as a check digit" +[8005b57f-f194-44ee-88d2-a77ac4142591] +description = "only one check digit is allowed" + +[fdb14c99-4cf8-43c5-b06d-eb1638eff343] +description = "X is not substituted by the value 10" + [f6294e61-7e79-46b3-977b-f48789a4945b] description = "valid isbn without separating dashes" diff --git a/exercises/practice/isbn-verifier/isbn_verifier_test.rb b/exercises/practice/isbn-verifier/isbn_verifier_test.rb index 9644cf6a36..d21f85f0bd 100644 --- a/exercises/practice/isbn-verifier/isbn_verifier_test.rb +++ b/exercises/practice/isbn-verifier/isbn_verifier_test.rb @@ -44,6 +44,18 @@ def test_x_is_only_valid_as_a_check_digit refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn" end + def test_only_one_check_digit_is_allowed + skip + string = '3-598-21508-96' + refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn" + end + + def test_x_is_not_substituted_by_the_value_10 + skip + string = '3-598-2X507-5' + refute IsbnVerifier.valid?(string), "Expected false, '#{string}' is not a valid isbn" + end + def test_valid_isbn_without_separating_dashes skip string = '3598215088' diff --git a/exercises/practice/perfect-numbers/.meta/tests.toml b/exercises/practice/perfect-numbers/.meta/tests.toml index ec28889154..81d484081c 100644 --- a/exercises/practice/perfect-numbers/.meta/tests.toml +++ b/exercises/practice/perfect-numbers/.meta/tests.toml @@ -27,6 +27,9 @@ description = "Abundant numbers -> Medium abundant number is classified correctl [ec7792e6-8786-449c-b005-ce6dd89a772b] description = "Abundant numbers -> Large abundant number is classified correctly" +[05f15b93-849c-45e9-9c7d-1ea131ef7d10] +description = "Abundant numbers -> Perfect square abundant number is classified correctly" + [e610fdc7-2b6e-43c3-a51c-b70fb37413ba] description = "Deficient numbers -> Smallest prime deficient number is classified correctly" diff --git a/exercises/practice/perfect-numbers/perfect_numbers_test.rb b/exercises/practice/perfect-numbers/perfect_numbers_test.rb index e44b403a40..c3b9f99860 100644 --- a/exercises/practice/perfect-numbers/perfect_numbers_test.rb +++ b/exercises/practice/perfect-numbers/perfect_numbers_test.rb @@ -32,6 +32,11 @@ def test_large_abundant_number_is_classified_correctly assert_equal 'abundant', PerfectNumber.classify(33_550_335) end + def test_perfect_square_abundant_number_is_classified_correctly + skip + assert_equal 'abundant', PerfectNumber.classify(196) + end + def test_smallest_prime_deficient_number_is_classified_correctly skip assert_equal 'deficient', PerfectNumber.classify(2) diff --git a/exercises/practice/simple-linked-list/.meta/tests.toml b/exercises/practice/simple-linked-list/.meta/tests.toml new file mode 100644 index 0000000000..b1e320ebbb --- /dev/null +++ b/exercises/practice/simple-linked-list/.meta/tests.toml @@ -0,0 +1,101 @@ +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. + +[962d998c-c203-41e2-8fbd-85a7b98b79b9] +description = "count -> Empty list has length of zero" + +[9760262e-d7e4-4639-9840-87e2e2fbb115] +description = "count -> Singleton list has length of one" + +[d9955c90-637c-441b-b41d-8cfb48e924a8] +description = "count -> Non-empty list has correct length" + +[0c3966db-58f9-4632-b94c-8ea13e54c2c8] +description = "pop -> Pop from empty list is an error" + +[a4f9d2e1-7425-49ef-9ee8-6c0cb3407cf0] +description = "pop -> Can pop from singleton list" + +[6dcbb2c9-d98a-47bc-a010-9c19703d3ea2] +description = "pop -> Can pop from non-empty list" + +[e83aade9-f030-4096-aaf0-f9dc6491e6cf] +description = "pop -> Can pop multiple items" + +[5c46bcf2-c0a9-4654-ae17-f3192436fcf1] +description = "pop -> Pop updates the count" + +[70d747a1-2e84-4ebc-bc3f-dcbee6a05f6b] +description = "push -> Can push to an empty list" +include = false + +[f3197f0a-1fea-45a5-939f-4a5ea60387ec] +description = "push -> Can push to an empty list" +reimplements = "70d747a1-2e84-4ebc-bc3f-dcbee6a05f6b" + +[391e332e-1f91-4033-b1e0-0e0c17812fa7] +description = "push -> Can push to a non-empty list" + +[ed4b0e01-3bbd-4895-af25-152b5914b3da] +description = "push -> Push updates count" + +[41666790-b932-4e5a-b323-e848a83d12d5] +description = "push -> Push and pop" + +[930a4a5c-76f6-47ec-9be3-4e70993173a1] +description = "peek -> Peek on empty list is an error" + +[43255a50-d919-4e81-afce-e4a271eaedbd] +description = "peek -> Can peek on singleton list" + +[48353020-e25d-4621-a854-e35fb1e15fa7] +description = "peek -> Can peek on non-empty list" + +[96fcead9-a713-46c2-8005-3f246c873851] +description = "peek -> Peek does not change the count" + +[7576ed05-7ff7-4b84-8efb-d34d62c110f5] +description = "peek -> Can peek after a pop and push" + +[b97d00b6-2fab-435d-ae74-3233dcc13698] +description = "toList LIFO -> Empty linked list to list is empty" + +[eedeb95f-b5cf-431d-8ad6-5854ba6b251c] +description = "toList LIFO -> To list with multiple values" + +[838678de-eaf3-4c14-b34e-7e35b6d851e8] +description = "toList LIFO -> To list after a pop" + +[03fc83a5-48a8-470b-a2d2-a286c5e8365f] +description = "toList FIFO -> Empty linked list to list is empty" + +[1282484e-a58c-426a-972e-90746bda61fc] +description = "toList FIFO -> To list with multiple values" + +[05ca3109-1249-4c0c-a567-a3b2f8352a7c] +description = "toList FIFO -> To list after a pop" + +[5e6c1a3d-e34b-46d3-be59-3f132a820ed5] +description = "reverse -> Reversed empty list has same values" + +[93c87ed3-862a-474f-820b-ba3fd6b6daf6] +description = "reverse -> Reversed singleton list is same list" + +[92851ebe-9f52-4406-b92e-0718c441a2ab] +description = "reverse -> Reversed non-empty list is reversed" +include = false + +[1210eeda-b23f-4790-930c-7ac6d0c8e723] +description = "reverse -> Reversed non-empty list is reversed" +reimplements = "92851ebe-9f52-4406-b92e-0718c441a2ab" + +[9b53af96-7494-4cfa-9b77-b7366fed5c4c] +description = "reverse -> Double reverse"