]> arthur.barton.de Git - bup.git/blobdiff - t/test-rm.sh
test-rm: ensure entire string matches in wv_matches_rx
[bup.git] / t / test-rm.sh
index e0c9b5307da380dfc3684665c654a4aa480ffb74..0887a9d1ad88a99a5a2b68bc99019d51282c44b2 100755 (executable)
@@ -27,7 +27,7 @@ wv_matches_rx()
     echo "$str" | sed 's/^\(.*\)/  \1/' 1>&2 || exit $?
     echo "Against:" 1>&2 || exit $?
     echo "$rx" | sed 's/^\(.*\)/  \1/' 1>&2 || exit $?
-    if [[ "$str" =~ $rx ]]; then
+    if [[ "$str" =~ ^${rx}$ ]]; then
         echo "! $src regex matches ok" 1>&2 || exit $?
     else
         echo "! $src regex doesn't match FAILED" 1>&2 || exit $?