mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-22 03:51:15 -03:00
Update littlecheck
4a3e4c8 Allow inline #CHECK directives and ignore double-commented directives
This commit is contained in:
@@ -14,14 +14,17 @@ import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Directives can occur at the beginning of a line, or anywhere in a line that does not start with #.
|
||||
COMMENT_RE = r'^(?:[^#].*)?#\s*'
|
||||
|
||||
# A regex showing how to run the file.
|
||||
RUN_RE = re.compile(r"\s*#\s*RUN:\s+(.*)\n")
|
||||
RUN_RE = re.compile(COMMENT_RE + r"RUN:\s+(.*)\n")
|
||||
|
||||
# A regex capturing lines that should be checked against stdout.
|
||||
CHECK_STDOUT_RE = re.compile(r"\s*#\s*CHECK:\s+(.*)\n")
|
||||
CHECK_STDOUT_RE = re.compile(COMMENT_RE + r"CHECK:\s+(.*)\n")
|
||||
|
||||
# A regex capturing lines that should be checked against stderr.
|
||||
CHECK_STDERR_RE = re.compile(r"\s*#\s*CHECKERR:\s+(.*)\n")
|
||||
CHECK_STDERR_RE = re.compile(COMMENT_RE + r"CHECKERR:\s+(.*)\n")
|
||||
|
||||
|
||||
class Config(object):
|
||||
|
||||
@@ -10,8 +10,7 @@ mkdir b
|
||||
touch ./b/file.txt
|
||||
|
||||
set dirs ./a ./b
|
||||
echo $dirs/*.txt
|
||||
# CHECK: ./b/file.txt
|
||||
echo $dirs/*.txt # CHECK: ./b/file.txt
|
||||
|
||||
cd $oldpwd
|
||||
rm -Rf $dir
|
||||
|
||||
Reference in New Issue
Block a user