[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] Additional test cases for printf field width, precision and
From: |
James Youngman |
Subject: |
[PATCH 6/8] Additional test cases for printf field width, precision and sign. |
Date: |
Sat, 18 Jun 2011 15:50:59 +0100 |
* find/testsuite/find.gnu/printf.exp: Add test cases for left and
right string alignment (%-10p), string truncation (%10.6p),
explicit signs (%+d), left and right alignment (%10p, %-10p),
zero-filling on decimal fields.
* find/testsuite/find.gnu/printf.xo: Add expected outputs for the
new tests.
---
ChangeLog | 9 +++++++++
find/testsuite/find.gnu/printf.exp | 2 +-
find/testsuite/find.gnu/printf.xo | 7 +++++++
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 946030d..25d45fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,16 @@
2011-06-18 James Youngman <address@hidden>
+ Additional test cases for printf field width, precision and sign.
+ * find/testsuite/find.gnu/printf.exp: Add test cases for left and
+ right string alignment (%-10p), string truncation (%10.6p),
+ explicit signs (%+d), left and right alignment (%10p, %-10p),
+ zero-filling on decimal fields.
+ * find/testsuite/find.gnu/printf.xo: Add expected outputs for the
+ new tests.
+
Add a test for find -printf ... %%.
* find/testsuite/find.gnu/printf.exp: Also test %%.
+
* find/testsuite/find.gnu/printf.xo: Add expected output for the
%% test case.
diff --git a/find/testsuite/find.gnu/printf.exp
b/find/testsuite/find.gnu/printf.exp
index 58031c4..ba8e75b 100644
--- a/find/testsuite/find.gnu/printf.exp
+++ b/find/testsuite/find.gnu/printf.exp
@@ -2,5 +2,5 @@ exec rm -rf tmp
exec mkdir tmp
exec touch tmp/file
exec chmod 600 tmp/file
-find_start p {tmp -type f -printf "a %d\n" -printf "b %f\n" -printf "c %h\n"
-printf "d %H\n" -printf "e %l\n" -printf "f %m\n" -printf "g %n\n" -printf "h
%p\n" -printf "i %P\n" -printf "j %y\n" -printf "k %Y\n" -printf "percent
it%%works%%\n"}
+find_start p {tmp -type f -printf "a %d\n" -printf "b %f\n" -printf "c %h\n"
-printf "d %H\n" -printf "e %l\n" -printf "f %m\n" -printf "g %n\n" -printf "h
%p\n" -printf "i %P\n" -printf "j %y\n" -printf "k %Y\n" -printf "percent
it%%works%%\n" -printf "string-right !%10p!\n" -printf "string-left !%-10p!\n"
-printf "trunc-R !%10.6p!\n" -printf "trunc-L !%-10.6p!\n" -printf "a5 !%5d!\n"
-printf "a05 !%05d!\n" -printf "a+ %+d\n" }
exec rm -rf tmp
diff --git a/find/testsuite/find.gnu/printf.xo
b/find/testsuite/find.gnu/printf.xo
index baacf2a..e607293 100644
--- a/find/testsuite/find.gnu/printf.xo
+++ b/find/testsuite/find.gnu/printf.xo
@@ -1,4 +1,7 @@
a 1
+a+ +1
+a5 ! 1!
+a05 !00001!
b file
c tmp
d tmp
@@ -10,3 +13,7 @@ i file
j f
k f
percent it%works%
+string-left !tmp/file !
+string-right ! tmp/file!
+trunc-L !tmp/fi !
+trunc-R ! tmp/fi!
--
1.7.2.5
- [PATCH 0/8] Print refactoring, James Youngman, 2011/06/18
- [PATCH 3/8] Remove an unnecessary argument from insert_fprintf., James Youngman, 2011/06/18
- [PATCH 5/8] Add a test for find -printf ... %%., James Youngman, 2011/06/18
- [PATCH 7/8] Reserve format specifiers %(, %{ and %[ for future use., James Youngman, 2011/06/18
- [PATCH 6/8] Additional test cases for printf field width, precision and sign.,
James Youngman <=
- [PATCH 4/8] Add a test for "find -printf \c"., James Youngman, 2011/06/18
- [PATCH 2/8] Add new test for octal and letter escapes in -printf format., James Youngman, 2011/06/18
- [PATCH 1/8] Split find's printf-related code into a new file., James Youngman, 2011/06/18
- [PATCH 8/8] Move the printing code into print.c., James Youngman, 2011/06/18