Add a few regression tests for printf(1).
This commit is contained in:
parent
fd79e6a683
commit
c7fefa410d
@ -1,5 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= file2c join jot m4 sed uudecode uuencode xargs
|
||||
SUBDIR= file2c join jot m4 printf sed uudecode uuencode xargs
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
4
tools/regression/usr.bin/printf/Makefile
Normal file
4
tools/regression/usr.bin/printf/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# $FreeBSD$
|
||||
|
||||
all:
|
||||
@m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR}
|
1
tools/regression/usr.bin/printf/regress.b.out
Normal file
1
tools/regression/usr.bin/printf/regress.b.out
Normal file
@ -0,0 +1 @@
|
||||
abcdef
|
1
tools/regression/usr.bin/printf/regress.d.out
Normal file
1
tools/regression/usr.bin/printf/regress.d.out
Normal file
@ -0,0 +1 @@
|
||||
123, 123,00123,00123,00123
|
1
tools/regression/usr.bin/printf/regress.f.out
Normal file
1
tools/regression/usr.bin/printf/regress.f.out
Normal file
@ -0,0 +1 @@
|
||||
42.250000,-42.250 ,inf,nan
|
1
tools/regression/usr.bin/printf/regress.m1.out
Normal file
1
tools/regression/usr.bin/printf/regress.m1.out
Normal file
@ -0,0 +1 @@
|
||||
a%97%
|
1
tools/regression/usr.bin/printf/regress.m2.out
Normal file
1
tools/regression/usr.bin/printf/regress.m2.out
Normal file
@ -0,0 +1 @@
|
||||
abc
|
4
tools/regression/usr.bin/printf/regress.m3.out
Normal file
4
tools/regression/usr.bin/printf/regress.m3.out
Normal file
@ -0,0 +1,4 @@
|
||||
%abc
|
||||
%def
|
||||
%ghi
|
||||
%jkl
|
1
tools/regression/usr.bin/printf/regress.m4.out
Normal file
1
tools/regression/usr.bin/printf/regress.m4.out
Normal file
@ -0,0 +1 @@
|
||||
0,0.000000,,
|
1
tools/regression/usr.bin/printf/regress.s.out
Normal file
1
tools/regression/usr.bin/printf/regress.s.out
Normal file
@ -0,0 +1 @@
|
||||
abc,abc
|
16
tools/regression/usr.bin/printf/regress.sh
Normal file
16
tools/regression/usr.bin/printf/regress.sh
Normal file
@ -0,0 +1,16 @@
|
||||
# $FreeBSD$
|
||||
|
||||
REGRESSION_START($1)
|
||||
|
||||
echo '1..8'
|
||||
|
||||
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')
|
||||
REGRESSION_TEST(`m1', `printf "%c%%%d\045\n" abc \"abc')
|
||||
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"')
|
||||
REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc')
|
||||
|
||||
REGRESSION_END()
|
6
tools/regression/usr.bin/printf/regress.t
Normal file
6
tools/regression/usr.bin/printf/regress.t
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
cd `dirname $0`
|
||||
|
||||
m4 ../regress.m4 regress.sh | sh
|
Loading…
Reference in New Issue
Block a user