From a0f6ef429c18cb32c51f26e3033465842ca70e7c Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Thu, 30 Jan 2020 08:13:32 -0800 Subject: [PATCH 1/9] Added multiple apostrophes test case --- exercises/word-count/word_count_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index 2d0317b5c5..f8e6d23a75 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -104,6 +104,12 @@ def test_non_alphanumeric(self): count_words("hey,my_spacebar_is_broken"), {"hey": 1, "my": 1, "spacebar": 1, "is": 1, "broken": 1}, ) + + def test_multiple_apostrophes_ignored(self): + self.assertEqual( + count_words("''hey''"), + {"hey": 1} + ) if __name__ == "__main__": From f6db263ed55a4f97013f0060a100bafeb9aff388 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Thu, 30 Jan 2020 10:39:57 -0800 Subject: [PATCH 2/9] Removed white space from line 107 for linting --- exercises/word-count/word_count_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index f8e6d23a75..43e8775c64 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -104,7 +104,7 @@ def test_non_alphanumeric(self): count_words("hey,my_spacebar_is_broken"), {"hey": 1, "my": 1, "spacebar": 1, "is": 1, "broken": 1}, ) - + def test_multiple_apostrophes_ignored(self): self.assertEqual( count_words("''hey''"), From f2248fa2baf1e537d6034a7bbbe01b4ca5c74b01 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Thu, 30 Jan 2020 10:44:04 -0800 Subject: [PATCH 3/9] Was missing comma for complex line composition --- exercises/word-count/word_count_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index 43e8775c64..c1dfa57368 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -108,7 +108,7 @@ def test_non_alphanumeric(self): def test_multiple_apostrophes_ignored(self): self.assertEqual( count_words("''hey''"), - {"hey": 1} + {"hey": 1}, ) From 9bd02042a636c2078ac060b6194014c210817025 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Sat, 1 Feb 2020 10:16:15 -0800 Subject: [PATCH 4/9] Update additional tests json to include apos test --- exercises/word-count/.meta/additional_tests.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/exercises/word-count/.meta/additional_tests.json b/exercises/word-count/.meta/additional_tests.json index 5385939838..5fafbb457e 100644 --- a/exercises/word-count/.meta/additional_tests.json +++ b/exercises/word-count/.meta/additional_tests.json @@ -33,6 +33,16 @@ "is": 1, "broken": 1 } + }, + { + "description": "multiple_apostrophes_ignored", + "property": "countWords", + "input": { + "sentence": "''hey''" + }, + "expected": { + "hey": 1 + } } ] } From b76cd4462644c44c594ac1e5bbdca15b47ae9db8 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Sat, 1 Feb 2020 10:23:15 -0800 Subject: [PATCH 5/9] Revert test file to pre-added test --- exercises/word-count/word_count_test.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index c1dfa57368..2d0317b5c5 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -105,12 +105,6 @@ def test_non_alphanumeric(self): {"hey": 1, "my": 1, "spacebar": 1, "is": 1, "broken": 1}, ) - def test_multiple_apostrophes_ignored(self): - self.assertEqual( - count_words("''hey''"), - {"hey": 1}, - ) - if __name__ == "__main__": unittest.main() From d38a967e597a3a96dba62789fbfa99a48ad47847 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Sat, 1 Feb 2020 10:32:51 -0800 Subject: [PATCH 6/9] Adds back test changes, "fixes" test description --- exercises/word-count/.meta/additional_tests.json | 2 +- exercises/word-count/word_count_test.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/exercises/word-count/.meta/additional_tests.json b/exercises/word-count/.meta/additional_tests.json index 5fafbb457e..39c9d22cbb 100644 --- a/exercises/word-count/.meta/additional_tests.json +++ b/exercises/word-count/.meta/additional_tests.json @@ -35,7 +35,7 @@ } }, { - "description": "multiple_apostrophes_ignored", + "description": "multiple apostrophes ignored", "property": "countWords", "input": { "sentence": "''hey''" diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index 2d0317b5c5..c1dfa57368 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -105,6 +105,12 @@ def test_non_alphanumeric(self): {"hey": 1, "my": 1, "spacebar": 1, "is": 1, "broken": 1}, ) + def test_multiple_apostrophes_ignored(self): + self.assertEqual( + count_words("''hey''"), + {"hey": 1}, + ) + if __name__ == "__main__": unittest.main() From 314cbcd2c743c33a207c018b796cc434d2aa5e67 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Sat, 1 Feb 2020 10:40:49 -0800 Subject: [PATCH 7/9] Generated test from generation script --- exercises/word-count/word_count_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index c1dfa57368..ef40389e12 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -2,7 +2,7 @@ from word_count import count_words -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.5.0 class WordCountTest(unittest.TestCase): @@ -77,6 +77,9 @@ def test_alternating_word_separators_not_detected_as_a_word(self): count_words(",\n,one,\n ,two \n 'three'"), {"one": 1, "two": 1, "three": 1} ) + def test_multiple_apostrophes_are_ignored(self): + self.assertEqual(count_words("''hey''"), {"hey": 1}) + # Additional tests for this track def test_tabs(self): @@ -106,10 +109,7 @@ def test_non_alphanumeric(self): ) def test_multiple_apostrophes_ignored(self): - self.assertEqual( - count_words("''hey''"), - {"hey": 1}, - ) + self.assertEqual(count_words("''hey''"), {"hey": 1}) if __name__ == "__main__": From 7762f7a1a2a5d09a8df5902ab8287992e194eb02 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Sat, 1 Feb 2020 10:49:44 -0800 Subject: [PATCH 8/9] File generation created the test twice? --- exercises/word-count/word_count_test.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index ef40389e12..da615de1ec 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -77,9 +77,6 @@ def test_alternating_word_separators_not_detected_as_a_word(self): count_words(",\n,one,\n ,two \n 'three'"), {"one": 1, "two": 1, "three": 1} ) - def test_multiple_apostrophes_are_ignored(self): - self.assertEqual(count_words("''hey''"), {"hey": 1}) - # Additional tests for this track def test_tabs(self): From 997099dd07827facc44241662472c04de5c70193 Mon Sep 17 00:00:00 2001 From: c4llmeco4ch Date: Mon, 3 Feb 2020 17:02:41 -0800 Subject: [PATCH 9/9] Reverted prob-spec data file to master copy --- exercises/word-count/word_count_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/word-count/word_count_test.py b/exercises/word-count/word_count_test.py index da615de1ec..741781631b 100644 --- a/exercises/word-count/word_count_test.py +++ b/exercises/word-count/word_count_test.py @@ -2,7 +2,7 @@ from word_count import count_words -# Tests adapted from `problem-specifications//canonical-data.json` @ v1.5.0 +# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0 class WordCountTest(unittest.TestCase):