aboutsummaryrefslogtreecommitdiff
path: root/tests/find.test
AgeCommit message (Collapse)Author
2020-10-06The non-recursive dirtree_path wasn't stripping a trailing / from initial path.Rob Landley
2020-07-30find: support -type a,b,c.Elliott Hughes
Fixes #227.
2019-11-05find.test: add missing tests for "accidentally" fixed bug.Elliott Hughes
Bug #69 was fixed recently by commit 0b2cfcb8fdea9673f3c2e0940f1b16d5825e16ea. Add the two tests from the bug so we can close it out. Fixes #69.
2019-10-12Fix argless find segfault.Denys Nykula
Inline array becomes garbage outside the if.
2019-09-04find: support -printf \0 octal escapes and \c.Elliott Hughes
I think when I wrote this I tested the named escapes like \n and hex escapes, and when I found \x wasn't supported I didn't even think of octal. And I only learned about \c when I was looking at echo and printf to compare their escape implementations a few weeks back. Add the missing escapes and corresponding tests. Fixes #139.
2019-08-30find: fix -name corner case.Elliott Hughes
This fixes the case where someone's done something (weird) like: find src/*.c -name foo.c Previously the match would fail because one side of the comparison was already a path.
2019-08-28Fix find(1) after c26870dab346.Elliott Hughes
Unlike ls, find does treat ENOENT specially. Add an extra test (and fix the behavior) for the case of ENOENT for a path provided on the command line --- unlike other ENOENT cases (typically dangling symlinks), ENOENT for a command line argument should report an error. Also remove obsolete `|sed` from the symlink loop test.
2019-08-15find.test: allow any error message about symlink loops.Elliott Hughes
glibc says "Too many levels of symbolic links", but BSD says "Too many symbolic links encountered". Until it becomes a problem, allow any error message.
2019-08-12find.test: fix flakiness.Elliott Hughes
Don't depend on directory iteration order in a test.
2019-08-09find: fix dangling symlink behavior.Elliott Hughes
ENOENT is ignored, but other errors are reported.
2019-06-11find: add -true/-false.Elliott Hughes
Used near the end of the AOSP build. Almost there! (This patch also fiddles with the help text to be able to slip the new options in without requiring so much extra space.)
2019-05-29Teach find -printf about %.Ns patterns, tweak help text, add tests.Rob Landley
2019-03-25find: fix inverted -exec exit statusVidar Holen
The return value of -exec was the command's exit code, which did not account for the fact that an exit code of zero means success, while in C, zero means failure. From POSIX: > the primary shall evaluate as true if the utility returns a zero > value as exit status This commit flips the return value, and adds two tests.
2019-03-11I've hit a test failure twice where find -newer didn't because the timestampsRob Landley
were identical, so add a small delay.
2019-02-13find: fix -path/-ipath and add -wholename/-iwholename synonyms.Elliott Hughes
Plus new tests.
2016-04-25Fix find bug reported by Tom Marshall, add test for it, and while we're at itRob Landley
fix two tests looking for a too-specific error message (so TEST_HOST failed).
2016-03-02Factor out command name at the start of test name, have runtest.sh print it.Rob Landley
2016-02-05Fix segfault when `find -iname` gets no argument.Josh Gao
2016-01-31Tweak to "find" tests.Rob Landley
2015-12-06Enable matching any perm bits.Gilad Arnold
Includes tests for the new feature, and a failure case for the minimal perms test as well. Also some typo fixing / massaging the help text so it fits in 80 columns.
2015-11-19Fix find -perm.Elliott Hughes
1) It read st_dev instead of st_mode. 2) It reversed the semantics of absolute vs minimal ('-' prefixed) tests. Add tests for these, and move the "unterminated -exec" test into the "Still fails" section because it's still dumping core for me.
2015-09-14Add find tests.Daniel K. Levy
2015-09-12Fix a find segfault.Rob Landley
Elliott Hughes found a bug https://android-review.googlesource.com/#/c/170020/ and Daniel K. Levy worked out the problem: the user/group/newer arguments to find weren't consuming their arguments when not checking the results of their comparison (because an earlier test had already caused their parenthetical group to fail). This confused the argument parsing logic and could lead to segfaults. I applied a different fix that reorganized the existing tests instead of adding a new test. (Looks like a big commit but it's mostly whitespace due to extra curly brackets changing indendentation levels.)
2015-05-12Set the executable bits on all the *.test files. (Wasn't consistent, is now.)Rob Landley
2014-09-20Move testsuite out of scripts/test into its own top level tests directory, ↵Rob Landley
and make ctrl-c kill "make test" more reliably.