Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 46 additions & 43 deletions exercises/practice/bob/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,82 +9,85 @@
# 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"

[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"

[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"
87 changes: 46 additions & 41 deletions exercises/practice/bob/bob-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@
(load-file "bob.el")
(declare-function response-for "bob.el" (phrase))

(ert-deftest responds-to-stating-something ()
(should (string= "Whatever." (response-for "Tom-ay-to, tom-aaaah-to."))))
(ert-deftest responds-to-asking-a-question ()
(should
(string= "Sure." (response-for "Does this cryogenic chamber make me look fat?"))))

(ert-deftest responds-to-shouting ()
(should
(string= "Whoa, chill out!" (response-for "WATCH OUT!"))))

(ert-deftest responds-to-shouting-gibberish ()
(ert-deftest responds-to-forceful-question ()
(should
(string= "Whoa, chill out!" (response-for "FCECDFCAAB"))))
(string= "Calm down, I know what I'm doing!" (response-for "WHAT'S GOING ON?"))))

(ert-deftest responds-to-asking-a-question ()
(ert-deftest responds-to-silence ()
(should
(string= "Sure." (response-for "Does this cryogenic chamber make me look fat?"))))
(string= "Fine. Be that way!" (response-for ""))))

(ert-deftest responds-to-stating-something ()
(should
(string= "Whatever." (response-for "Tom-ay-to, tom-aaaah-to."))))

(ert-deftest responds-to-asking-a-numeric-question ()
(should
Expand All @@ -31,78 +36,78 @@
(should
(string= "Sure." (response-for "fffbbcbeab?"))))

(ert-deftest responds-to-talking-forcefully ()
(ert-deftest responds-to-question-with-no-letters ()
(should
(string= "Whatever." (response-for "Hi there!"))))
(string= "Sure." (response-for "4?"))))

(ert-deftest responds-to-using-acronyms-in-regular-speech ()
(ert-deftest responds-to-non-letters-with-question ()
(should
(string= "Whatever." (response-for "It's OK if you don't want to go work for NASA."))))
(string= "Sure." (response-for ":) ?"))))

(ert-deftest responds-to-forceful-question ()
(ert-deftest responds-to-prattling-on ()
(should
(string= "Calm down, I know what I'm doing!" (response-for "WHAT'S GOING ON?"))))
(string= "Sure." (response-for "Wait! Hang on. Are you going to be OK?"))))

(ert-deftest responds-to-shouting-numbers ()
(ert-deftest responds-to-ending-with-whitespace ()
(should
(string= "Whoa, chill out!" (response-for "1, 2, 3 GO!"))))
(string= "Sure." (response-for "Okay if like my spacebar quite a bit? "))))

(ert-deftest responds-to-only-numbers ()
(ert-deftest responds-to-multiple-line-question ()
(should
(string= "Whatever." (response-for "1, 2, 3"))))
(string= "Sure." (response-for "\nDoes this cryogenic chamber make\n me look fat?"))))

(ert-deftest responds-to-questions-with-only-numbers ()
(ert-deftest responds-to-shouting-gibberish ()
(should
(string= "Sure." (response-for "4?"))))
(string= "Whoa, chill out!" (response-for "FCECDFCAAB"))))

(ert-deftest responds-to-shouting-with-special-chars ()
(ert-deftest responds-to-shouting-a-statement-containing-a-question-mark ()
(should
(string= "Whoa, chill out!" (response-for "DO LIONS EAT PEOPLE? AHHHHH."))))

(ert-deftest responds-to-shouting-numbers ()
(should
(string= "Whoa, chill out!" (response-for "1, 2, 3 GO!"))))

(ert-deftest responds-to-shouting-with-special-characters ()
(should
(string= "Whoa, chill out!" (response-for "ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"))))

(ert-deftest responds-to-shouting-with-no-exclamation-mark ()
(should
(string= "Whoa, chill out!" (response-for "I HATE THE DENTIST"))))

(ert-deftest responds-to-statement-containing-question-mark ()
(ert-deftest responds-to-prolonged-silence ()
(should
(string= "Whatever." (response-for "Ending with ? means a question."))))
(string= "Fine. Be that way!" (response-for " "))))

(ert-deftest responds-to-non-letters-with-question ()
(ert-deftest responds-to-alternate-silence ()
(should
(string= "Sure." (response-for ":) ?"))))
(string= "Fine. Be that way!" (response-for "\t\t\t\t\t\t\t\t\t\t"))))

(ert-deftest responds-to-prattling-on ()
(ert-deftest responds-to-other-whitespace ()
(should
(string= "Sure." (response-for "Wait! Hang on. Are you going to be OK?"))))
(string= "Fine. Be that way!" (response-for "\n\r \t"))))

(ert-deftest responds-to-silence ()
(ert-deftest responds-to-talking-forcefully ()
(should
(string= "Fine. Be that way!" (response-for ""))))
(string= "Whatever." (response-for "Hi there!"))))

(ert-deftest responds-to-prolonged-silence ()
(ert-deftest responds-to-using-acronyms-in-regular-speech ()
(should
(string= "Fine. Be that way!" (response-for " "))))
(string= "Whatever." (response-for "It's OK if you don't want to go work for NASA."))))

(ert-deftest responds-to-alternate-silence ()
(ert-deftest responds-to-no-letters ()
(should
(string= "Fine. Be that way!" (response-for "\t\t\t\t\t\t\t\t\t\t"))))
(string= "Whatever." (response-for "1, 2, 3"))))

(ert-deftest responds-to-multiple-line-question ()
(ert-deftest responds-to-statement-containing-question-mark ()
(should
(string= "Sure." (response-for "\nDoes this cryogenic chamber make\n me look fat?"))))
(string= "Whatever." (response-for "Ending with ? means a question."))))

(ert-deftest responds-to-starting-with-whitespace ()
(should
(string= "Whatever." (response-for " hmmmmmmm..."))))

(ert-deftest responds-to-ending-with-whitespace ()
(should
(string= "Sure." (response-for "Okay if like my spacebar quite a bit? "))))

(ert-deftest responds-to-other-whitespace ()
(should
(string= "Fine. Be that way!" (response-for "\n\r \t"))))

(ert-deftest responds-to-non-question-ending-with-whitespace ()
(should
(string= "Whatever." (response-for "This is a statement ending with whitespace "))))
Expand Down