diff options
author | Jim Meyering <jim@meyering.net> | 2004-07-08 14:03:20 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-07-08 14:03:20 +0000 |
commit | 405c640f5b337b05d53c03432039c3417cbd14a4 (patch) | |
tree | c90fa8834ccf552ba2d7f21b07bca98a9987c30e /tests/misc | |
parent | 3f6161568104c2ceb893a7beb88bd18293bdea91 (diff) | |
download | coreutils-405c640f5b337b05d53c03432039c3417cbd14a4.tar.xz |
printf cleanup, to avoid undefined behavior, to add support for
formats that Bash supports, and to support wide integers like
Bash does.
Add tests for the above.
Diffstat (limited to 'tests/misc')
-rwxr-xr-x | tests/misc/printf | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/misc/printf b/tests/misc/printf index 431e685da..64d16f336 100755 --- a/tests/misc/printf +++ b/tests/misc/printf @@ -63,6 +63,20 @@ $prog '7 \2y \02y \002y \0002y\n' |tr '\0\2' '*=' >> out $prog '8 %b %b %b %b\n' '\1y' '\01y' '\001y' '\0001y'|tr '\1' = >> out +$prog '9 %*dx\n' -2 0 >>out || fail=1 + +$prog '10 %.*dx\n' -2147483648 0 >>out || fail=1 + +$prog '11 %*c\n' 2 x >>out || fail=1 + +$prog '%#d\n' 0 >>out 2> /dev/null && fail=1 + +$prog '%0s\n' 0 >>out 2> /dev/null && fail=1 + +$prog '%.9c\n' 0 >>out 2> /dev/null && fail=1 + +$prog '%'\''s\n' 0 >>out 2> /dev/null && fail=1 + cat <<\EOF > exp 1 x y 2 failed, as expected @@ -72,6 +86,9 @@ cat <<\EOF > exp 6 ! 7 =y =y =y *2y 8 =y =y =y =y +9 0 x +10 0x +11 x EOF cmp out exp || fail=1 |