File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,16 @@ def test_title_before_and_after_prefixed_last_name(self) -> None:
5555 self .m (hn .last , "van Gogh" , hn )
5656 self .m (hn .suffix , "dr" , hn )
5757
58+ def test_many_repeated_prefixes_does_not_blow_up (self ) -> None :
59+ # Issue #108: a name with a long run of repeated prefixes used to grow
60+ # the pieces list exponentially and exhaust memory. Guard against a
61+ # regression: this must parse quickly and not raise. If an exponential
62+ # code path is reintroduced, this test will hang (CI timeout catches it).
63+ name = "Jan " + "van der " * 30 + "Berg"
64+ hn = HumanName (name )
65+ self .assertFalse (hn .unparsable )
66+ self .m (hn .first , "Jan" , hn )
67+
5868 def test_two_part_last_name_with_suffix_comma (self ) -> None :
5969 hn = HumanName ("pennie von bergen wessels, III" )
6070 self .m (hn .first , "pennie" , hn )
You can’t perform that action at this time.
0 commit comments