Skip to content

Commit f8bbc91

Browse files
authored
Rollup merge of #143814 - lolbinarycat:htmldocck-negative-err, r=fmease
htmldocck: better error messages for some negative directives Previously it was saying "did not match pattern" even when the error was that it did match the pattern, and it wasn't supposed to.
2 parents 95b5a08 + 507fd38 commit f8bbc91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/etc/htmldocck.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,14 @@ def check_command(c, cache):
564564
# hasraw/matchesraw <path> <pat> = string test
565565
elif len(c.args) == 2 and "raw" in c.cmd:
566566
cerr = "`PATTERN` did not match"
567+
if c.negated:
568+
cerr = "`PATTERN` unexpectedly matched"
567569
ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
568570
# has/matches <path> <pat> <match> = XML tree test
569571
elif len(c.args) == 3 and "raw" not in c.cmd:
570572
cerr = "`XPATH PATTERN` did not match"
573+
if c.negated:
574+
cerr = "`XPATH PATTERN` unexpectedly matched"
571575
ret = get_nb_matching_elements(cache, c, regexp, True) != 0
572576
else:
573577
raise InvalidCheck("Invalid number of {} arguments".format(c.cmd))

0 commit comments

Comments
 (0)