Skip to content

Commit b898807

Browse files
authored
word-count: Add multiple apostrophes test case (#2169)
* Added multiple apostrophes test case * Removed white space from line 107 for linting * Was missing comma for complex line composition * Update additional tests json to include apos test * Revert test file to pre-added test * Adds back test changes, "fixes" test description * Generated test from generation script * File generation created the test twice? * Reverted prob-spec data file to master copy
1 parent 85f84e2 commit b898807

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

exercises/word-count/.meta/additional_tests.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"is": 1,
3434
"broken": 1
3535
}
36+
},
37+
{
38+
"description": "multiple apostrophes ignored",
39+
"property": "countWords",
40+
"input": {
41+
"sentence": "''hey''"
42+
},
43+
"expected": {
44+
"hey": 1
45+
}
3646
}
3747
]
3848
}

exercises/word-count/word_count_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def test_non_alphanumeric(self):
105105
{"hey": 1, "my": 1, "spacebar": 1, "is": 1, "broken": 1},
106106
)
107107

108+
def test_multiple_apostrophes_ignored(self):
109+
self.assertEqual(count_words("''hey''"), {"hey": 1})
110+
108111

109112
if __name__ == "__main__":
110113
unittest.main()

0 commit comments

Comments
 (0)