From f4b8e8356b6a2a1d0250b0c4beb4714b5b366a73 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Tue, 3 Jan 2012 14:59:55 -0300 Subject: [PATCH] test-bash-functions: test_name is optional, so avoid it stopping us if set -u --- util/test-bash-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/test-bash-functions b/util/test-bash-functions index 1a14a0de..c6c0cd61 100755 --- a/util/test-bash-functions +++ b/util/test-bash-functions @@ -93,7 +93,7 @@ run_test() { # Print a TAP-style test result. result() { local result=$1 - local test_name=$2 + local test_name=${2:-""} if [ $result -eq 0 ]; then echo "ok $testno - $TEST_FILE $test_name" else @@ -115,7 +115,7 @@ result() { no_diff() { local got=$1 local expected=$2 - local test_name=$3 + local test_name=${3:-""} test_command="diff $got $expected" eval $test_command > $TEST_TMPDIR/failed_result 2>&1 result $? "$test_name" @@ -124,7 +124,7 @@ no_diff() { is() { local got=$1 local expected=$2 - local test_name=$3 + local test_name=${3:-""} test_command="\"$got\" == \"$expected\"" test "$got" = "$expected" result $? "$test_name" @@ -132,7 +132,7 @@ is() { cmd_ok() { local test_command=$1 - local test_name=$2 + local test_name=${2:-""} eval $test_command result $? "$test_name" }