def test_no_input(monkeypatch): monkeypatch.setattr('sys.stdin', noInput) assert wordCount.wordCounter() == 0
def test_special2(monkeypatch): monkeypatch.setattr('sys.stdin', specialCharInput2) assert wordCount.wordCounter() == 4
def test_one_word(monkeypatch): monkeypatch.setattr('sys.stdin', oneWordInput) assert wordCount.wordCounter() == 1
def test_string_of_numbers(monkeypatch): monkeypatch.setattr('sys.stdin', numberInput) assert wordCount.wordCounter() == 10
def test_many_spaces(monkeypatch): monkeypatch.setattr('sys.stdin', multipleSpaces) assert wordCount.wordCounter() == 9
def test_add(self): self.assertEqual(wordCount.wordCounter("This is 4 words."), 4) self.assertEqual(wordCount.wordCounter("A few more cool words."), 5)
def test_add_numbers(self): self.assertEqual(wordCount.wordCounter("1 2 3 4 5 6 7 8"), 8)
def test_no_words(self, mock_input): result = wordCount.wordCounter() self.assertEqual(result, 0)
def test_add_spaces(self): self.assertEqual(wordCount.wordCounter(" This is incorrect"), 3)
def test_special_chars_complex(self, mock_input): result = wordCount.wordCounter() self.assertEqual(result, 5)
def test_one_word(self, mock_input): result = wordCount.wordCounter() self.assertEqual(result, 1)
def test_string_with_multiple_spaces(self, mock_input): result = wordCount.wordCounter() self.assertEqual(result, 10)
def test_string_of_ints(self, mock_input): result = wordCount.wordCounter() self.assertEqual(result, 10)
def test_numbers(): assert wordCount.wordCounter("1 2 3 4 5 6 7 8") == 8
def test_answer(): assert wordCount.wordCounter("This is 4 words.") == 4 assert wordCount.wordCounter("A few more cool words.") == 5
def test_spaces(): assert wordCount.wordCounter(" This is incorrect") == 3