2005-04-13 20:08:17 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
REGRESSION_START($1)
|
|
|
|
|
2014-05-29 19:48:18 +00:00
|
|
|
echo '1..23'
|
2005-04-13 20:08:17 +00:00
|
|
|
|
|
|
|
REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"')
|
|
|
|
REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123')
|
|
|
|
REGRESSION_TEST(`f', `printf "%f,%-8.3f,%f,%f\n" +42.25 -42.25 inf nan')
|
2011-05-28 11:37:47 +00:00
|
|
|
REGRESSION_TEST(`l1', `LC_ALL=en_US.ISO8859-1 printf "%d\n" $(printf \"\\344)')
|
|
|
|
REGRESSION_TEST(`l2', `LC_ALL=en_US.UTF-8 printf "%d\n" $(printf \"\\303\\244)')
|
2005-04-14 18:33:14 +00:00
|
|
|
REGRESSION_TEST(`m1', `printf "%c%%%d\0\045\n" abc \"abc')
|
2005-04-13 20:08:17 +00:00
|
|
|
REGRESSION_TEST(`m2', `printf "abc\n\cdef"')
|
|
|
|
REGRESSION_TEST(`m3', `printf "%%%s\n" abc def ghi jkl')
|
|
|
|
REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"')
|
2010-12-08 22:54:18 +00:00
|
|
|
REGRESSION_TEST(`m5', `printf -- "-d\n"')
|
2005-04-13 20:08:17 +00:00
|
|
|
REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc')
|
2012-12-18 21:02:38 +00:00
|
|
|
REGRESSION_TEST('zero', `printf "%u%u\n" 15')
|
2012-12-18 21:42:45 +00:00
|
|
|
REGRESSION_TEST('zero', `printf "%d%d\n" 15')
|
|
|
|
REGRESSION_TEST('zero', `printf "%d%u\n" 15')
|
|
|
|
REGRESSION_TEST('zero', `printf "%u%d\n" 15')
|
2014-05-26 15:08:39 +00:00
|
|
|
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')
|
2005-04-13 20:08:17 +00:00
|
|
|
|
|
|
|
REGRESSION_END()
|