Skip to content

Instantly share code, notes, and snippets.

Created July 13, 2014 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f26f15c7ea495238c57d to your computer and use it in GitHub Desktop.
Save anonymous/f26f15c7ea495238c57d to your computer and use it in GitHub Desktop.
(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