aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-05-29 16:02:16 -0500
committerRob Landley <rob@landley.net>2019-05-29 16:02:16 -0500
commita58d45a7d0afd1667dd1e5c8e318944a02aeab28 (patch)
treed06a7908bb3de7c139b46d6e4322cac22e0f00f4 /tests
parent40f6cc7e04e17107f95cab165b2d9021d3946ac6 (diff)
downloadtoybox-a58d45a7d0afd1667dd1e5c8e318944a02aeab28.tar.gz
Teach find -printf about %.Ns patterns, tweak help text, add tests.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/find.test28
1 files changed, 12 insertions, 16 deletions
diff --git a/tests/find.test b/tests/find.test
index 6b0b0a8a..26ad1626 100755
--- a/tests/find.test
+++ b/tests/find.test
@@ -81,15 +81,11 @@ testing "-exec {} +" \
"find dir -type f -exec ls {} +" "dir/file\n" "" ""
# `find . -iname` was segfaulting
-testing "-name file" \
- "find dir -name file" "dir/file\n" "" ""
-testing "-name FILE" \
- "find dir -name FILE" "" "" ""
+testing "-name file" "find dir -name file" "dir/file\n" "" ""
+testing "-name FILE" "find dir -name FILE" "" "" ""
-testing "-iname file" \
- "find dir -iname FILE" "dir/file\n" "" ""
-testing "-iname FILE" \
- "find dir -iname FILE" "dir/file\n" "" ""
+testing "-iname file" "find dir -iname FILE" "dir/file\n" "" ""
+testing "-iname FILE" "find dir -iname FILE" "dir/file\n" "" ""
testing "-name (no arguments)" \
@@ -100,13 +96,13 @@ testing "-iname (no arguments)" \
testing "" "find dir \( -iname file -o -iname missing \) -exec echo {} \;" \
"dir/file\n" "" ""
-testing "-path glob" \
- "find dir -path 'dir*e'" "dir/file\n" "" ""
-testing "-wholename glob" \
- "find dir -wholename 'dir*e'" "dir/file\n" "" ""
-testing "-ipath glob" \
- "find dir -ipath 'dIr*E'" "dir/file\n" "" ""
-testing "-iwholename glob" \
- "find dir -iwholename 'dIr*E'" "dir/file\n" "" ""
+testing "-path glob" "find dir -path 'dir*e'" "dir/file\n" "" ""
+testing "-wholename glob" "find dir -wholename 'dir*e'" "dir/file\n" "" ""
+testing "-ipath glob" "find dir -ipath 'dIr*E'" "dir/file\n" "" ""
+testing "-iwholename glob" "find dir -iwholename 'dIr*E'" "dir/file\n" "" ""
+testing "-printf" "find dir -name file -printf '%f %p %P %s'" \
+ "file dir/file file 0" "" ""
+testing "-printf .N" "find dir -name file -printf %.2f" "fi" "" ""
+
rm -rf dir