diff options
| author | binarycat <binarycat@envs.net> | 2025-07-11 13:56:18 -0500 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2025-07-11 13:56:18 -0500 |
| commit | 507fd38a3fd2121d4a39df6fcf14eb50f868d471 (patch) | |
| tree | 51528e8836f10a626efbf16e0b80ae8abab3753c /src/etc | |
| parent | 78a6e132984dba0303ebad7dcfd1305c93ad5835 (diff) | |
| download | rust-507fd38a3fd2121d4a39df6fcf14eb50f868d471.tar.gz rust-507fd38a3fd2121d4a39df6fcf14eb50f868d471.zip | |
htmldocck: better error messages for negative raw directives
Diffstat (limited to 'src/etc')
| -rwxr-xr-x | src/etc/htmldocck.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/etc/htmldocck.py b/src/etc/htmldocck.py index 1806e2be9bb..ddbd256a0d8 100755 --- a/src/etc/htmldocck.py +++ b/src/etc/htmldocck.py @@ -564,10 +564,14 @@ def check_command(c, cache): # hasraw/matchesraw <path> <pat> = string test elif len(c.args) == 2 and "raw" in c.cmd: cerr = "`PATTERN` did not match" + if c.negated: + cerr = "`PATTERN` unexpectedly matched" ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp) # has/matches <path> <pat> <match> = XML tree test elif len(c.args) == 3 and "raw" not in c.cmd: cerr = "`XPATH PATTERN` did not match" + if c.negated: + cerr = "`XPATH PATTERN` unexpectedly matched" ret = get_nb_matching_elements(cache, c, regexp, True) != 0 else: raise InvalidCheck("Invalid number of {} arguments".format(c.cmd)) |
