summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2018-06-23tests: New test for -depth in the presence of read errorsTavian Barnes
2018-01-20printf: Add %w and %Wk for file birth timesTavian Barnes
%w and %W were chosen to match the format specifiers for file birth times from stat(1)
2017-11-12exec: Recover from E2BIGTavian Barnes
2017-11-05parse: Support -perm +7777, for compatibility with BSD and old GNU findTavian Barnes
2017-10-21parse: Keep track of what files are already openTavian Barnes
Fixes #22
2017-09-17opt: Fix -depth with arguments bigger than INT_MAXTavian Barnes
2017-09-16tests: Add tests that trigger some optimizationsTavian Barnes
2017-09-07Revert "tests: Test hardlinks to symlinks"Tavian Barnes
Apparently macOS doesn't support ln -P. This reverts commit 80eec18020f531abbdb2abbb919ab6c6fa34107c.
2017-09-06parse: Don't reorder or remove tests with potential side effectsTavian Barnes
-empty and -xtype may have side effects like reporting permission errors, which even affect the exit status of bfs. We shouldn't remove these effects without -Ofast.
2017-09-06tests: Test hardlinks to symlinksTavian Barnes
2017-09-04tests: Make test_deep pass with other find implementationsTavian Barnes
And move test_deep_strict to the bfs-specific tests, since it's not likely to ever pass for other implementations.
2017-09-02tests: Use human-readable filenames in links/Tavian Barnes
2017-08-16tests: Remove unnecessary sort-args.sh invocationsTavian Barnes
2017-08-12Unify broken symlink handlingTavian Barnes
Rather than open-code the fallback logic for broken symlinks everywhere it's needed, introduce a new xfstatat() utility function that performs the fallback automatically. Using xfstatat() consistently fixes a few bugs, including cases where broken symlinks are given as arguments to predicates like -samefile.
2017-08-12tests: Add a test for -exec ... {} + with a failing commandTavian Barnes
2017-07-29exec: Fix more corner cases with -ok ... +Tavian Barnes
-ok should look for a ; even if it sees {} +, according to POSIX.
2017-07-29exec: Don't allow anything between {} and +Tavian Barnes
POSIX explicitly forbids this extension: > Only a <plus-sign> that immediately follows an argument containing > only the two characters "{}" shall punctuate the end of the primary > expression. Other uses of the <plus-sign> shall not be treated as > special.
2017-07-21Fix a couple terrible optimizer bugsTavian Barnes
Just because an expression is always true or false, doesn't mean we can execute it more often than it otherwise would be, unless it's also pure. But that's equivalent to being identically -true/-false, so just check that.
2017-07-21Implement -printxTavian Barnes
Also from NetBSD.
2017-07-20eval: Add some sanity checksTavian Barnes
2017-07-20Implement -exit [STATUS]Tavian Barnes
From NetBSD again.
2017-07-20Implement -rm as an alias for -deleteTavian Barnes
From NetBSD.
2017-07-09Handle ENOTDIR the same as ENOENTTavian Barnes
For a/b/c, ENOTDIR is returned instead of ENOENT if a or b are not directories. Handle this uniformly when detecting broken symlinks, readdir races, etc.
2017-07-08bftw: Fix ENAMETOOLONG handling when the root is closedTavian Barnes
The root has depth == 0, but we still need to include it in the components array.
2017-07-08bftw: Recover from ENAMETOOLONGTavian Barnes
It is always possible to force a breadth-first traversal to encounter ENAMETOOLONG, regardless of the dircache eviction policy. As a concrete example, consider this directory structure: ./1/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... (longer than {PATH_MAX}) ./2/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... ./3/{NAME_MAX}/{NAME_MAX}/{NAME_MAX}/... ... (more than RLIMIT_NOFILE directories under .) Eventually, the next file to be processed will not have any parents in the cache, as the cache can only hold RLIMIT_NOFILE entries. Then the whole path must be traversed from ., which will exceed {PATH_MAX} bytes. Work around this by performing a component-by-component traversal manually when we see ENAMETOOLONG. This is required by POSIX: > The find utility shall be able to descend to arbitrary depths in a file > hierarchy and shall not fail due to path length limitations (unless a > path operand specified by the application exceeds {PATH_MAX} > requirements).
2017-06-15-perm: Handle permcopy (e.g. u=rw,g=u) correctlyTavian Barnes
2017-06-11tests: Fix test_printf_nul with non-GNU sortTavian Barnes
Other UNIX sort implementations seem to truncate at the nul bytes, so open-code it without the sort.
2017-06-10printf: Fix embedded nul bytesTavian Barnes
Fixes #26.
2017-05-11Don't make -quit disable the implicit -printTavian Barnes
2017-04-23Implement -fstypeTavian Barnes
Fixes #6!
2017-04-16Implement -XTavian Barnes
2017-04-16tests: Add tests for bfs extensions to -exec ... +Tavian Barnes
2017-04-15Implement -exec/-execdir ... +Tavian Barnes
2017-03-11tests: Run everything in UTCTavian Barnes
2017-03-11Add a test for colored outputTavian Barnes
2017-03-11Implement -printf %Ak, %Ck, and %TkTavian Barnes
2017-02-11Add some tests for the operators themselvesTavian Barnes
2017-02-10Add tests for bfs's flexible command line parsingTavian Barnes
2017-02-09bftw: Make the nameoff of "///" point to "/"Tavian Barnes
This simplifies a few things such as -name handling for ///.
2017-02-09Give the test cases human-readable namesTavian Barnes
2017-02-09Don't close stdin for -ok or -okdirTavian Barnes
Turns out it violates POSIX, even though GNU find does it.
2017-02-08Add support for -x?type with multiple typesTavian Barnes
This functionality is already part of GNU findutils git.
2017-02-06Fix a memory leak parsing -printfTavian Barnes
2017-02-05Make -quit happen immediately, not at the end of the current expressionTavian Barnes
2017-02-05bftw: Compute nameoff correctly for the root in BFTW_DEPTH modeTavian Barnes
2017-02-05Implement -printf/-fprintfTavian Barnes
Based on a patch by Fangrui Song <i@maskray.me>. Closes #16.
2017-02-04Implement -nouser and -nogroupTavian Barnes
2017-01-03tests: Add a test for -inumTavian Barnes
2017-01-02tests: Add tests for -quitTavian Barnes
2016-12-21Set _FILE_OFFSET_BITS to 64Tavian Barnes
With the new support for -size n[TP], this is needed to avoid overflow on 32-bit platforms.