Skip to content

Commit f5d227e

Browse files
committed
test: escape the remaining confusable test characters
An ideographic full stop and a combining diaeresis on an ASCII letter in the domain lookalike tests, and the fullwidth digits in the Spanish identifier tests, read as plain ASCII in the source. Write them as escapes; the test values are unchanged.
1 parent e792a57 commit f5d227e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎tests/i18n/test_es.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,14 @@ def test_returns_true_on_valid_doi(value: str):
127127
assert es_doi(value)
128128

129129

130-
@pytest.mark.parametrize("digits", ["0123456789", "٠١٢٣٤٥٦٧٨٩", "०१२३४५६७८९"])
130+
@pytest.mark.parametrize(
131+
"digits",
132+
[
133+
"\uff10\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19",
134+
"\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669",
135+
"\u0966\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f",
136+
],
137+
)
131138
@pytest.mark.parametrize(
132139
"validate,value",
133140
[

‎tests/test_domain.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_returns_failed_validation_on_domain_beyond_rfc_limits(value: str):
178178
"example.\u217dom", # small roman numeral one hundred
179179
"\u212aelvin.com", # Kelvin sign
180180
"\u017fhop.com", # long s
181-
"example。com", # ideographic full stop
181+
"example\u3002com", # ideographic full stop
182182
"example\uff0ecom", # fullwidth full stop
183183
"example\uff61com", # halfwidth ideographic full stop
184184
"exam\u00adple.com", # soft hyphen
@@ -187,7 +187,7 @@ def test_returns_failed_validation_on_domain_beyond_rfc_limits(value: str):
187187
"exam\ufe0fple.com", # variation selector
188188
"examp\u2060le.com", # word joiner
189189
"\ufeffexample.com", # zero width no-break space
190-
"exämple.com".replace("ä", "ä"), # not NFC
190+
"exämple.com".replace("ä", "a\u0308"), # not NFC
191191
],
192192
)
193193
@pytest.mark.parametrize("consider_tld", [False, True])

0 commit comments

Comments
 (0)