Skip to content

Commit

Permalink
tweak to validate syntax test to account for block Miao codepoints
Browse files Browse the repository at this point in the history
  • Loading branch information
emily-roth committed Oct 9, 2024
1 parent a1d3a84 commit 5f51c36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def test_syntax(ldml):
for i in exemplars_rawnocurly[t]:
if "\\" in i:
if r"\u" in i:
assert len(i)==6, filename + " " + n + " exemplar has unicode codepoint(s) missing hex digits: " + i
assert len(i)>=6, filename + " " + n + " exemplar has unicode codepoint(s) missing hex digits: " + i
if r"\U" in i:
assert len(i)==10, filename + " " + n + " exemplar has unicode codepoint(s) missing hex digits: " + i
#this next assert does assume that spaces were added between units in an exemplar, since exemplars_rawnocurly can only insert a space BEFORE a backslash. So far nothing fails incorrectly because of that
assert len(i)<3 or len(i)==6 or len(i)==10, filename + " " + n + " exemplar has unicode codepoint(s) missing 'u' or 'U': " + i
#assert len(i)<3 or len(i)==6 or len(i)==10, filename + " " + n + " exemplar has unicode codepoint(s) missing 'u' or 'U': " + i
# The following lines are a test if characters are incorrectly unescaped.
# The problem with these coming tests is that if there are ranges that use special characters intentionally, they'll ping as errors.
# However we can't solely test for "is it a valid regex" bc they might make a valid regex on accident.
Expand Down

0 comments on commit 5f51c36

Please sign in to comment.