Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/awk add a test case for PR/47306



details:   https://anonhg.NetBSD.org/src/rev/87db1169184d
branches:  trunk
changeset: 783200:87db1169184d
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Dec 10 20:30:06 2012 +0000

description:
add a test case for PR/47306

diffstat:

 tests/usr.bin/awk/t_awk.sh |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (35 lines):

diff -r 125d2847e260 -r 87db1169184d tests/usr.bin/awk/t_awk.sh
--- a/tests/usr.bin/awk/t_awk.sh        Mon Dec 10 19:49:05 2012 +0000
+++ b/tests/usr.bin/awk/t_awk.sh        Mon Dec 10 20:30:06 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_awk.sh,v 1.4 2012/03/17 23:22:59 christos Exp $
+# $NetBSD: t_awk.sh,v 1.5 2012/12/10 20:30:06 christos Exp $
 #
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -335,6 +335,19 @@
                -x "printf '\n\n\nr1f1\nr1f2\n\nr2f1\nr2f2\n\n\n' | $awk '{\$1=\$1}1' RS= OFS=:"
 }
 
+atf_test_case modify_subsep
+
+modify_subsep_head() {
+       atf_set "descr" "Test awk(1) SUPSEP modification (PR/47306)"
+}
+
+modify_subsep_body() {
+       atf_check \
+               -o "inline:1\n1\n1\n" \
+               -x "printf '1\n1 2\n' | \
+               $awk '1{ arr[\$1 SUBSEP \$2 SUBSEP ++cnt[\$1]]=1} {for (f in arr) print arr[f];}'"
+}
+
 atf_init_test_cases() {
 
        atf_add_test_case big_regexp
@@ -361,4 +374,5 @@
        atf_add_test_case regex_reallocation_rs
        atf_add_test_case empty_rs
        atf_add_test_case newline_rs
+       atf_add_test_case modify_subsep
 }



Home | Main Index | Thread Index | Old Index