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.
This commit is contained in:
parent
de02f72cd7
commit
99d693d647
|
|
@ -47,7 +47,7 @@ function assert_eq() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function assert_substr() {
|
function assert_substr() {
|
||||||
if [[ "$1" =~ "$2" ]]; then
|
if [[ "$1" == *"$2"* ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fail "'$1' does not contain '$2'"
|
fail "'$1' does not contain '$2'"
|
||||||
|
|
@ -855,7 +855,7 @@ for arg; do
|
||||||
if [[ "${t}" =~ ${arg} ]]; then
|
if [[ "${t}" =~ ${arg} ]]; then
|
||||||
nmatches=$((nmatches+1))
|
nmatches=$((nmatches+1))
|
||||||
# Don't run tests twice, just keep the first match.
|
# Don't run tests twice, just keep the first match.
|
||||||
if [[ " ${tests_to_run[*]} " =~ " ${t} " ]]; then
|
if [[ " ${tests_to_run[*]} " == *" ${t} "* ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
tests_to_run+=("${t}")
|
tests_to_run+=("${t}")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue