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