Skip to content

Commit 2a3fef7

Browse files
derek73claude
andcommitted
test: replace placeholder tests with ones that exercise the new regex
The two replaced tests passed via pre-existing collapse_whitespace logic and didn't exercise space_before_comma at all. Replaced with: - suffix-present path (regression guard against over-stripping) - multiple empty fields before comma Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f6f76ae commit 2a3fef7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test_output_format.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ def test_empty_field_drops_surrounding_whitespace(self) -> None:
109109
hn.string_format = "{last} {suffix}, {first}"
110110
self.assertEqual(str(hn), "Smith, John")
111111

112-
def test_empty_field_drops_surrounding_punctuation(self) -> None:
113-
hn = HumanName("John Smith")
114-
hn.string_format = "{title} {first} {last}"
115-
self.assertEqual(str(hn), "John Smith")
112+
def test_empty_field_present_suffix_unaffected(self) -> None:
113+
hn = HumanName("John Smith Jr")
114+
hn.string_format = "{last} {suffix}, {first}"
115+
self.assertEqual(str(hn), "Smith Jr, John")
116116

117-
def test_empty_field_interior_comma_dropped(self) -> None:
117+
def test_multiple_empty_fields_before_comma(self) -> None:
118118
hn = HumanName("John Smith")
119-
hn.string_format = "{last}, {suffix} {first}"
120-
self.assertEqual(str(hn), "Smith, John")
119+
hn.string_format = "{title} {suffix}, {first} {last}"
120+
self.assertEqual(str(hn), "John Smith")
121121

122122
def test_remove_emojis(self) -> None:
123123
hn = HumanName("Sam Smith 😊")

0 commit comments

Comments
 (0)