[Toybox] [PATCH] Add find tests.

Daniel K. Levy alliedenvy at gmail.com
Mon Sep 14 15:21:27 PDT 2015


On Mon, 2015-09-14 at 16:45 -0500, Daniel K. Levy wrote:
> +testing "find unterminated -exec {} [fail]" \
> +  "find dir -type f -exec ls {} 2>/dev/null || echo yes" "yes\n" "" ""

Sigh. This doesn't work. One more time:

diff --git a/tests/find.test b/tests/find.test
index 65bbb50..c632703 100755
--- a/tests/find.test
+++ b/tests/find.test
@@ -39,8 +39,17 @@ testing "find -type f -a -print" \
 testing "find -print -o -print" \
        "find dir -type f -a \( -print -o -print \)" "dir/file\n" "" ""
 
-# these were erroring or segfaulting:
-# find -type f -user nobody -exec : \;
-# find -type f -user nobody -exec : -exec : \;
+# Testing previous failures
+
+testing "find -type f -user -exec" \
+  "find dir -type f -user $USER -exec ls {} \\;" "dir/file\n" "" ""
+
+TZ=UTC touch -t 196907210256.15 dir/file # Vingean epoch
+testing "find -type l -newer -exec" \
+  "find dir -type l -newer dir/file -exec ls {} \\;" "dir/link\n" "" ""
+testing "find unterminated -exec {} [fail]" \
+  "find dir -type f -exec ls {} 2>/dev/null" "" "" ""
+testing "find -exec {} +" \
+  "find dir -type f -exec ls {} +" "dir/file\n" "" ""
 
 rm -rf dir

 1442269287.0


More information about the Toybox mailing list