From ac467aea1fc1dd31bcbc50ff9dd158fa91f6b8a9 Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 26 May 2014 15:08:39 +0000 Subject: [PATCH] printf(1): add tests for warn about incomplete uses n$ Submitted by: jilles MFC after: 2 weeks --- usr.bin/printf/tests/regress.missingpos1.out | 1 + usr.bin/printf/tests/regress.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 usr.bin/printf/tests/regress.missingpos1.out diff --git a/usr.bin/printf/tests/regress.missingpos1.out b/usr.bin/printf/tests/regress.missingpos1.out new file mode 100644 index 000000000000..3b04f033ef26 --- /dev/null +++ b/usr.bin/printf/tests/regress.missingpos1.out @@ -0,0 +1 @@ +printf: incomplete use of n$ diff --git a/usr.bin/printf/tests/regress.sh b/usr.bin/printf/tests/regress.sh index 84e183b99397..15b82847f9ab 100644 --- a/usr.bin/printf/tests/regress.sh +++ b/usr.bin/printf/tests/regress.sh @@ -19,5 +19,13 @@ REGRESSION_TEST('zero', `printf "%u%u\n" 15') REGRESSION_TEST('zero', `printf "%d%d\n" 15') REGRESSION_TEST('zero', `printf "%d%u\n" 15') REGRESSION_TEST('zero', `printf "%u%d\n" 15') +REGRESSION_TEST(`missingpos1', `printf "%1\$*s" 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$s" 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*.*1\$s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*2\$.*s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%*1\$.*2\$s" 1 1 1 2>&1') +REGRESSION_TEST(`missingpos1', `printf "%1\$*.*2\$s" 1 1 1 2>&1') REGRESSION_END()