diff options
author | rillig <rillig@pkgsrc.org> | 2005-11-24 19:18:45 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-11-24 19:18:45 +0000 |
commit | cfadbbe5f6679e53fff389d1d1c32558989324a3 (patch) | |
tree | 3fda8828af3027568201289b0562f459e05a1592 /regress/tools/files/awk-test.sh | |
parent | 28769c643ff5457ccd0f1fbfe1c9f0237dd2ba8b (diff) | |
download | pkgsrc-cfadbbe5f6679e53fff389d1d1c32558989324a3.tar.gz |
Factored out the generally useable shell functions into tests.subr, as they
will be used by almost all test cases.
Diffstat (limited to 'regress/tools/files/awk-test.sh')
-rw-r--r-- | regress/tools/files/awk-test.sh | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/regress/tools/files/awk-test.sh b/regress/tools/files/awk-test.sh index 828904ec209..2b28eb03cd1 100644 --- a/regress/tools/files/awk-test.sh +++ b/regress/tools/files/awk-test.sh @@ -1,39 +1,11 @@ #! /bin/sh -# $NetBSD: awk-test.sh,v 1.5 2005/11/19 22:55:24 rillig Exp $ +# $NetBSD: awk-test.sh,v 1.6 2005/11/24 19:18:45 rillig Exp $ # set -e -# usage: testcase_start <testname> -testcase_start() { - printf "Running testcase %s\\n" "$1" -} - -# usage: assert_equal <testname> <expected> <got> -assert_equal() { - case $2 in - "$3") ;; - *) echo "[assert_equal:$1] expected \"$2\", got \"$3\"." 1>&2 - return 1;; - esac -} - -# usage: test_assignment <testname> <input> <expected-output> -test_assignment() { - testcase_start "$1" - o=`echo "" | awk '{print var}' var="$2"` - assert_equal "$1" "$3" "${o}" -} - -# usage: test_passline <testname> <input> -test_passline() { - testcase_start "$1" - o=`awk '{print}' <<EOF -$2 -EOF -` - assert_equal "$1" "$2" "${o}" -} +mydir=`dirname "$0"` +. "${mydir}/tests.subr" # # Assignment of variables from the command line. The Solaris |