@@ -3298,67 +3298,18 @@ def test_address_list_with_long_unwrapable_comment(self):
32983298 policy = self .policy .clone (max_line_length = 40 )
32993299 cases = [
33003300 # (to, folded)
3301-
3302- # 1. Unwrappable Comments
3303-
3304- # Entire line is <= 40 characters, 40 characters exactly
3305- # No folding
3306- ('spy@example.org(loremipsumdolorsitametc)' , 'spy@example.org(loremipsumdolorsitametc)\n ' ),
3307- ('(loremipsumdolorsitametc)spy@example.org' , '(loremipsumdolorsitametc)spy@example.org\n ' ),
3308- # Entire line is > 40 characters, 41 characters
3309- # Folding triggered
3310- ('spy@example.org(loremipsumdolorsitametco)' ,'spy@example.org\n (loremipsumdolorsitametco)\n ' ),
3311- ('(loremipsumdolorsitametco)spy@example.org' , '(loremipsumdolorsitametco)spy@example.org\n ' ),
3312- # Entire line is > 40 characters, 54 characters, `len(tstr) <= maxlen - len(lines[-1])` is `True`
3313- # Folding triggered
3314- # Comment part < 40 characthers, 39 characters, `len(tstr) + 1 <= maxlen` is `True`
3315- # No attempt to fold the subpart
3316- ('spy@example.org(loremipsumdolorsitametconsecteturadip)' ,
3317- 'spy@example.org\n '
3318- ' (loremipsumdolorsitametconsecteturadip)\n ' ),
3319- ('(loremipsumdolorsitametconsecteturadip)spy@example.org' ,
3320- '(loremipsumdolorsitametconsecteturadip)spy@example.org\n ' ),
3321- # Entire line is > 40 characters, 55 characters, `len(tstr) <= maxlen - len(lines[-1])` is `True`
3322- # Folding triggered
3323- # Comment part >= 40 characters, 40 characters exactly, `len(tstr) + 1 <= maxlen` is `False`
3324- # Attempt to fold the subpart
3325- ('spy@example.org(loremipsumdolorsitametconsecteturadipi)' ,
3326- 'spy@example.org\n '
3327- ' (loremipsumdolorsitametconsecteturadipi)\n ' ),
3328- ('(loremipsumdolorsitametconsecteturadipi)spy@example.org' ,
3329- '(loremipsumdolorsitametconsecteturadipi)spy@example.org\n ' ),
3330-
3331- # 2. Wrappable comments
3332-
3333- # Entire line is <= 40 characters, 40 characters exactly
3334- # No folding
3335- ('spy@example.org(loremipsumd olorsitamet)' , 'spy@example.org(loremipsumd olorsitamet)\n ' ),
3336- ('(loremipsumd olorsitamet)spy@example.org' , '(loremipsumd olorsitamet)spy@example.org\n ' ),
3337- # Entire line is > 40 characters, 41 characters
3338- # Folding triggered
3339- # Comment part < 40 characters
3340- ('spy@example.org(loremipsumd olorsitametc)' , 'spy@example.org\n (loremipsumd olorsitametc)\n ' ),
3341- ('(loremipsumd olorsitametc)spy@example.org' , '(loremipsumd olorsitametc)spy@example.org\n ' ),
3342- # Entire line is > 40 characters, 56 characters
3343- # Folding triggered
3344- # Comment part > 40 characters, 41 characters
3345- ('spy@example.org(loremipsumd loremipsumdolorsitametconse)' , 'spy@example.org(loremipsumd\n loremipsumdolorsitametconse)\n ' ),
3346- ('(loremipsumd loremipsumdolorsitametconse)spy@example.org' , '(loremipsumd\n loremipsumdolorsitametconse)spy@example.org\n ' ),
3347- # Entire line is > 40 characters, 70 characters
3348- # Folding triggered
3349- # Comment part > 40 characters, 55 characters
3350- # One word in the comment > 40 characters, 41 characters
3351- ('spy@example.org(loremipsumd loremipsumdolorsitametconsecteturadipisci)' , 'spy@example.org(loremipsumd\n loremipsumdolorsitametconsecteturadipisci)\n ' ),
3352- ('(loremipsumd loremipsumdolorsitametconsecteturadipisci)spy@example.org' , '(loremipsumd\n loremipsumdolorsitametconsecteturadipisci)spy@example.org\n ' ),
3353-
3354- # 3. Nested comments
3355-
3356- ('spy@example.org((loremipsumdolorsitametconsecteturadi))' , 'spy@example.org(\n (loremipsumdolorsitametconsecteturadi))\n ' ),
3357- ('spy@example.org((loremipsumdolorsitametconsecteturadip))' , 'spy@example.org(\n (loremipsumdolorsitametconsecteturadip)\n )\n ' ),
3358- ('spy@example.org((loremipsumdolorsitam)(loremipsumdolorsitam))' , 'spy@example.org((loremipsumdolorsitam)\n (loremipsumdolorsitam))\n ' ),
3359- ('spy@example.org((loremipsumdolorsitametc)(loremipsumdolorsitametc))' , 'spy@example.org(\n (loremipsumdolorsitametc)\n (loremipsumdolorsitametc))\n ' ),
3360- ('spy@example.org(loremipsumdolorsitametc(loremipsumdolorsitametc))' , 'spy@example.org(loremipsumdolorsitametc\n (loremipsumdolorsitametc))\n ' ),
3361- ('spy@example.org((loremipsumdolorsitametc)loremipsumdolorsitametc)' , 'spy@example.org(\n (loremipsumdolorsitametc)\n loremipsumdolorsitametc)\n ' ),
3301+ ('(loremipsumdolorsitametconsecteturadipi)<spy@example.org>' ,
3302+ '(loremipsumdolorsitametconsecteturadipi)<spy@example.org>\n ' ),
3303+ ('<spy@example.org>(loremipsumdolorsitametconsecteturadipi)' ,
3304+ '<spy@example.org>(loremipsumdolorsitametconsecteturadipi)\n ' ),
3305+ ('(loremipsum dolorsitametconsecteturadipi)<spy@example.org>' ,
3306+ '(loremipsum dolorsitametconsecteturadipi)<spy@example.org>\n ' ),
3307+ ('<spy@example.org>(loremipsum dolorsitametconsecteturadipi)' ,
3308+ '<spy@example.org>(loremipsum\n dolorsitametconsecteturadipi)\n ' ),
3309+ ('(Escaped \\ ( \\ ) chars \\ \\ in comments stay escaped)<spy@example.org>' ,
3310+ '(Escaped \\ ( \\ ) chars \\ \\ in comments stay\n escaped)<spy@example.org>\n ' ),
3311+ ('((loremipsum)(loremipsum)(loremipsum)(loremipsum))<spy@example.org>' ,
3312+ '((loremipsum)(loremipsum)(loremipsum)(loremipsum))<spy@example.org>\n ' ),
33623313 ]
33633314 for (to , folded ) in cases :
33643315 with self .subTest (to = to ):
0 commit comments