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 | dc73dcb087c252025cd31416922c4bd92e821570 (patch) | |
tree | 45d402080f259424b6cfdb19a37460017e77bd95 /regress/tools/files/awk-test.sh | |
parent | cfadbbe5f6679e53fff389d1d1c32558989324a3 (diff) | |
download | pkgsrc-dc73dcb087c252025cd31416922c4bd92e821570.tar.gz |
Oops. I had put the awk-specific functions into test.subr. Moved back.
Diffstat (limited to 'regress/tools/files/awk-test.sh')
-rw-r--r-- | regress/tools/files/awk-test.sh | 27 |
1 files changed, 26 insertions, 1 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 |