Skip to content

Commit

Permalink
test: Fix regex syntax warnings in pathological_tests.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof authored and jgm committed Jan 15, 2024
1 parent 623aba2 commit bbc081b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/pathological_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def badhash(ref):

document = ''.join("[%s]: /url\n\n[%s]\n\n" % (key, bad_key) for key in collisions)

return document, re.compile("(<p>\[%s\]</p>\n){%d}" % (bad_key, COUNT-1))
return document, re.compile(r"(<p>\[%s]</p>\n){%d}" % (bad_key, COUNT-1))


# list of pairs consisting of input and a regex that must match the output.
Expand Down Expand Up @@ -103,10 +103,10 @@ def badhash(ref):
re.compile("^<p>[e`]*</p>\n$")),
"unclosed links A":
("[a](<b" * 30000,
re.compile("(\\[a\]\\(&lt;b){30000}")),
re.compile(r"(\[a]\(&lt;b){30000}")),
"unclosed links B":
("[a](b" * 30000,
re.compile("(\\[a\\]\\(b){30000}")),
re.compile(r"(\[a]\(b){30000}")),
"unclosed <!--":
("</" + "<!--" * 300000,
re.compile("\\&lt;\\/(\\&lt;!--){300000}")),
Expand Down

0 comments on commit bbc081b

Please sign in to comment.