Created
July 13, 2014 17:56
-
-
Save anonymous/f26f15c7ea495238c57d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftest text->words-test-case | |
(testing "no text" | |
(is (= (text->words "") nil))) | |
(testing "one word" | |
(is (= (text->words "foo") ["foo"]))) | |
(testing "one word in a sentence" | |
(is (= (text->words "Hello!") ["hello"]))) | |
(testing "two words" | |
(is (= (text->words "foo bar") ["foo" "bar"]))) | |
(testing "short-hand for “what is“" | |
(is (= (text->words "what's") ["what's"]))) | |
(testing "two sentences" | |
(is (= (text->words "Hello, world! What's up?") | |
["hello" "world" "what's" "up"])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment