From b960d5e3cc1abd1849ef6c0019f16ab7dd77e52a Mon Sep 17 00:00:00 2001 From: Duncaen Date: Fri, 31 Mar 2017 16:10:43 +0200 Subject: t: add check_test --- t/lib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't/lib.sh') diff --git a/t/lib.sh b/t/lib.sh index 81c2dd1..567250b 100644 --- a/t/lib.sh +++ b/t/lib.sh @@ -14,6 +14,17 @@ check() { true } +check_test() { + msg=$1; op=$2; test=$3; shift 3 + if [ "$(eval "$@" 2>/dev/null)" "$op" "$test" ]; then + printf 'ok - %s\n' "$msg" + else + printf 'not ok - %s\n' "$msg" + false + fi + true +} + check_same() { msg=$1 shift -- cgit 1.4.1