Improve test framework: assertExpr '~' operator

The '~' (regular expression match) operator does not implicitly anchor the
expression to the ends of the text, ie, does not put ^...$ around the pattern.
That leaves the test writer free to specify a full or anchored or interior
match.
This commit is contained in:
Andrew Bettison 2012-08-17 17:56:42 +09:30
parent 9310a15cbd
commit d678680d40

View File

@ -921,7 +921,7 @@ _tfw_matches_rexp() {
local rexp="$1"
shift
for arg; do
if ! echo "$arg" | grep -q -e "^$rexp\$"; then
if ! echo "$arg" | grep -q -e "$rexp"; then
return 1
fi
done