Regression tests for awk(1) (PR 44063)

This commit is contained in:
cheusov 2011-11-22 20:22:09 +00:00
parent bc81369a28
commit 91dbf71977
6 changed files with 46 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.425 2011/11/21 23:50:44 joerg Exp $
# $NetBSD: mi,v 1.426 2011/11/22 20:22:09 cheusov Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -2713,6 +2713,9 @@
./usr/tests/util/Atffile tests-util-tests
./usr/tests/util/awk tests-util-tests
./usr/tests/util/awk/Atffile tests-util-tests
./usr/tests/util/awk/d_assign_NF.awk tests-util-tests
./usr/tests/util/awk/d_assign_NF.in tests-util-tests
./usr/tests/util/awk/d_assign_NF.out tests-util-tests
./usr/tests/util/awk/d_big_regexp.awk tests-util-tests
./usr/tests/util/awk/d_big_regexp.in tests-util-tests
./usr/tests/util/awk/d_big_regexp.out tests-util-tests

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2011/04/30 11:24:14 alnsn Exp $
# $NetBSD: Makefile,v 1.3 2011/11/22 20:22:10 cheusov Exp $
NOMAN= # defined
@ -29,5 +29,8 @@ FILES+= d_tolower.out
FILES+= d_toupper.awk
FILES+= d_toupper.in
FILES+= d_toupper.out
FILES+= d_assign_NF.awk
FILES+= d_assign_NF.in
FILES+= d_assign_NF.out
.include <bsd.test.mk>

View File

@ -0,0 +1,16 @@
# $NetBSD: d_assign_NF.awk,v 1.1 2011/11/22 20:22:10 cheusov Exp $
{
NF = 2
print "$0=`" $0 "`"
print "$3=`" $3 "`"
print "$4=`" $4 "`"
NF = 3
print "$0=`" $0 "`"
print "$3=`" $3 "`"
print "$4=`" $4 "`"
NF = 4
print "$0=`" $0 "`"
print "$3=`" $3 "`"
print "$4=`" $4 "`"
}

View File

@ -0,0 +1 @@
1 2 3

View File

@ -0,0 +1,9 @@
$0=`1 2`
$3=``
$4=``
$0=`1 2 `
$3=``
$4=``
$0=`1 2 `
$3=``
$4=``

View File

@ -1,4 +1,4 @@
# $NetBSD: t_awk.sh,v 1.6 2011/05/02 08:30:21 jruoho Exp $
# $NetBSD: t_awk.sh,v 1.7 2011/11/22 20:22:10 cheusov Exp $
#
# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@ -98,6 +98,16 @@ period_body()
h_check period -v x=0.5
}
atf_test_case assign_NF
assign_NF_head()
{
atf_set "descr" 'Checks that assign to NF changes $0 and $n (PR/44063)'
}
assign_NF_body()
{
h_check assign_NF
}
atf_init_test_cases()
{
atf_add_test_case big_regexp
@ -105,4 +115,5 @@ atf_init_test_cases()
atf_add_test_case string1
atf_add_test_case multibyte
atf_add_test_case period
atf_add_test_case assign_NF
}