Fix positional argument parsing

reorganize-docker-tests
Ryo Kawaguchi 2024-04-18 23:35:50 +09:00
parent 8de1996a7a
commit 34e703fdc4
1 changed files with 2 additions and 2 deletions

View File

@ -36,6 +36,8 @@ while [[ $# -gt 0 ]]; do
;;
*)
TEST_FILTER+=("$1")
shift
;;
esac
done
@ -200,9 +202,7 @@ test_simultaneous_redemption() {
# Run tests (functions prefixed with test_) in alphabetical order.
# Optional filter provided by positional arguments is applied.
for func in $(declare -F | awk '{print $3}'); do
echo '-'$func
if [[ "$func" =~ ^test_ ]]; then
echo '='$func
if [ ${#TEST_FILTER[@]} -eq 0 ] || [[ "${TEST_FILTER[*]}" =~ "$func" ]]; then
$func
fi