Skip to content
Closed
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
4 changes: 4 additions & 0 deletions e2e_toy/tests/test_textops.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ class WordCountTest(unittest.TestCase):
def test_single_spaces(self):
self.assertEqual(word_count("a b c"), 3)

def test_repeated_spaces(self):
self.assertEqual(word_count("hello world"), 2)
self.assertEqual(word_count(" padded\ttext\n"), 2)


class SlugifyTest(unittest.TestCase):
def test_basic(self):
Expand Down
2 changes: 1 addition & 1 deletion e2e_toy/textops.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def word_count(text):
"""Number of whitespace-separated words in ``text``."""
return len(text.split(" "))
return len(text.split())


def slugify(text):
Expand Down
Loading