mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-19 05:07:56 +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"
|
||||
shift
|
||||
for arg; do
|
||||
if ! echo "$arg" | grep -q -e "^$rexp\$"; then
|
||||
if ! echo "$arg" | grep -q -e "$rexp"; then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user