1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-09-29 20:48:27 +02:00

exec-test: Replace type -t with command -F

Also eliminates a subshell.
This commit is contained in:
Mike Bland 2017-02-15 10:13:20 -05:00
parent 3bc03796e9
commit 698fa766a3
No known key found for this signature in database
GPG Key ID: 5121C73A6E07384B

View File

@ -289,7 +289,7 @@ bats_perform_tests() {
bats_perform_test() {
BATS_TEST_NAME="$1"
if [ "$(type -t "$BATS_TEST_NAME" || true)" = "function" ]; then
if declare -F "$BATS_TEST_NAME" >/dev/null; then
BATS_TEST_NUMBER="$2"
if [ -z "$BATS_TEST_NUMBER" ]; then
echo "1..1"