Skip to content

Commit 99d693d

Browse files
committed
test_git.sh: replace test regex for glob match
Don't quote rhs of =~, it'll match literally rather than as a regex. Fixes SC2076. Part of #891.
1 parent de02f72 commit 99d693d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test_git.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function assert_eq() {
4747
}
4848

4949
function assert_substr() {
50-
if [[ "$1" =~ "$2" ]]; then
50+
if [[ "$1" == *"$2"* ]]; then
5151
return
5252
fi
5353
fail "'$1' does not contain '$2'"
@@ -855,7 +855,7 @@ for arg; do
855855
if [[ "${t}" =~ ${arg} ]]; then
856856
nmatches=$((nmatches+1))
857857
# Don't run tests twice, just keep the first match.
858-
if [[ " ${tests_to_run[*]} " =~ " ${t} " ]]; then
858+
if [[ " ${tests_to_run[*]} " == *" ${t} "* ]]; then
859859
continue
860860
fi
861861
tests_to_run+=("${t}")

0 commit comments

Comments
 (0)