Skip to content

Commit be0b617

Browse files
derek73claude
andcommitted
test: add boundary tests for single-char alpha vs symbol conjunction handling
Documents the intentional asymmetry introduced in #151: non-alpha symbols like & are always honored as conjunctions, while single-char alpha conjunctions (e, y) still fall back to initial treatment in short names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 64a789e commit be0b617

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/test_conjunctions.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ def test_couple_titles_ampersand_conjunction(self) -> None:
119119
self.m(hn.first, "John", hn)
120120
self.m(hn.last, "Smith", hn)
121121

122+
def test_ampersand_conjunction_short_name_no_titles(self) -> None:
123+
# & is non-alpha so it should always be honored as a conjunction,
124+
# even when total_length < 4 (no titles to inflate the count)
125+
hn = HumanName('John & Jane')
126+
self.m(hn.first, "John & Jane", hn)
127+
128+
def test_single_char_alpha_conjunction_still_treated_as_initial_when_short(self) -> None:
129+
# single-char alpha conjunctions (e, y) are still treated as initials
130+
# when total_length < 4; only non-alpha symbols like & bypass this guard
131+
hn = HumanName('John y Jane')
132+
self.m(hn.first, "John", hn)
133+
self.m(hn.middle, "y", hn)
134+
self.m(hn.last, "Jane", hn)
135+
122136
def test_title_with_three_part_name_last_initial_is_suffix_uppercase_no_period(self) -> None:
123137
hn = HumanName("King John Alexander V")
124138
self.m(hn.title, "King", hn)

0 commit comments

Comments
 (0)