diff options
author | rillig <rillig@pkgsrc.org> | 2005-11-24 19:20:18 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-11-24 19:20:18 +0000 |
commit | 8a9316673558bd33208a4b280c8cef567386f598 (patch) | |
tree | 45d402080f259424b6cfdb19a37460017e77bd95 | |
parent | 35f0921edb3e5b4c51d9e40fde352d6064cb78c5 (diff) | |
download | pkgsrc-8a9316673558bd33208a4b280c8cef567386f598.tar.gz |
Oops. I had put the awk-specific functions into test.subr. Moved back.
-rw-r--r-- | regress/tools/files/awk-test.sh | 27 | ||||
-rw-r--r-- | regress/tools/files/tests.subr | 19 |
2 files changed, 27 insertions, 19 deletions
diff --git a/regress/tools/files/awk-test.sh b/regress/tools/files/awk-test.sh index 2b28eb03cd1..931c574de25 100644 --- a/regress/tools/files/awk-test.sh +++ b/regress/tools/files/awk-test.sh @@ -1,5 +1,5 @@ #! /bin/sh -# $NetBSD: awk-test.sh,v 1.6 2005/11/24 19:18:45 rillig Exp $ +# $NetBSD: awk-test.sh,v 1.7 2005/11/24 19:20:18 rillig Exp $ # set -e @@ -8,6 +8,31 @@ mydir=`dirname "$0"` . "${mydir}/tests.subr" # +# Functions specific for the awk testsuite. +# + +# 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}" +} + +# +# The actual test. +# + +# # Assignment of variables from the command line. The Solaris # /usr/bin/awk does not conform to the POSIX specification, but passes # the right hand side of the assignment uninterpreted. It fails the diff --git a/regress/tools/files/tests.subr b/regress/tools/files/tests.subr index 204657b364a..8079dfbc55d 100644 --- a/regress/tools/files/tests.subr +++ b/regress/tools/files/tests.subr @@ -1,4 +1,4 @@ -# $NetBSD: tests.subr,v 1.1 2005/11/24 19:18:45 rillig Exp $ +# $NetBSD: tests.subr,v 1.2 2005/11/24 19:20:18 rillig Exp $ # # usage: testcase_start <testname> @@ -14,20 +14,3 @@ assert_equal() { 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}" -} |