From 5d3ade84a4d83975f26cfea2b6b6931701cffdfc Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 10 Feb 2017 19:11:20 +0100 Subject: [PATCH] TST On Python 3 --version comes out in STDERR so test that too --- tests/bash_tap_fd.sh | 2 +- tests/version.t | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/bash_tap_fd.sh b/tests/bash_tap_fd.sh index d55b2e7..2bd2003 100644 --- a/tests/bash_tap_fd.sh +++ b/tests/bash_tap_fd.sh @@ -33,7 +33,7 @@ function skip_if_not_git { } function get_internal_version { - echo -e "grep . ${bashtap_org_pwd}/../CHANGELOG.md | head -n 1 | cut -d ' ' -f 2" + echo -e "$(grep '\.' ${bashtap_org_pwd}/../CHANGELOG.md | head -n 1 | cut -d ' ' -f 2)" } # Cut out the first two fields, from log as they are date and time (which would make it impossible to test ;D) diff --git a/tests/version.t b/tests/version.t index 4ebaf31..b928a9f 100755 --- a/tests/version.t +++ b/tests/version.t @@ -3,9 +3,11 @@ CMD=$(get_script) GIT_VERSION="git describe --tags" -EXPECTED_VERSION=$(get_internal_version) +EXPECTED_VERSION="get_internal_version" -skip_if_not_git || diff -u <(${CMD} --version || kill $$) <($GIT_VERSION) -diff -u <(cd / && ${CMD} --version || kill $$) <($EXPECTED_VERSION) +[ "x${GIT_VERSION}" != "x" ] +[ "x${EXPECTED_VERSION}" != "x" ] +skip_if_not_git || diff -u <(${CMD} --version 2>&1 || kill $$) <($GIT_VERSION) +diff -u <(cd / && ${CMD} --version 2>&1 || kill $$) <($EXPECTED_VERSION) # vim: ai sts=4 et sw=4