mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-23 15:02:27 +00:00
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:
parent
9310a15cbd
commit
d678680d40
@ -921,7 +921,7 @@ _tfw_matches_rexp() {
|
|||||||
local rexp="$1"
|
local rexp="$1"
|
||||||
shift
|
shift
|
||||||
for arg; do
|
for arg; do
|
||||||
if ! echo "$arg" | grep -q -e "^$rexp\$"; then
|
if ! echo "$arg" | grep -q -e "$rexp"; then
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user