printf(1): add tests for warn about incomplete uses n$

Submitted by:	jilles
MFC after:	2 weeks
This commit is contained in:
Pedro F. Giffuni 2014-05-26 15:08:39 +00:00
parent 4aa1792423
commit f764fa47f0
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1 @@
printf: incomplete use of n$

View File

@ -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()