diff --git a/tests/usr.bin/awk/t_awk.sh b/tests/usr.bin/awk/t_awk.sh index 8ffac2f6370b..77cb5f86df01 100644 --- a/tests/usr.bin/awk/t_awk.sh +++ b/tests/usr.bin/awk/t_awk.sh @@ -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 @@ newline_rs_body() { -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_init_test_cases() { 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 }