summaryrefslogtreecommitdiffstats
path: root/tests/bfs
Commit message (Collapse)AuthorAgeFilesLines
* color: Fix an infinite loop colorizing some invalid pathsTavian Barnes2024-10-132-0/+2
| | | | | | | | | | | | | | Previously, given $ touch file $ ln -s file/file notdir $ bfs notdir/file bfs would loop forever when printing the error message, since it expected stripping the trailing slash from "notdir/" to fix the ENOTDIR error, but the broken symlink still gave the same error. Fixes: b4c3201 ("color: Only highlight the trailing slash on ENOTDIR")
* color: Fix an assertion failure with embedded NUL bytesTavian Barnes2024-10-022-0/+32
| | | | | | | | | | | | | Leading NUL bytes (e.g. `*\0.gz=...`) could cause us to insert a non-prefix-free set of strings into the case-insensitive extension trie, which would lead to crashes like bfs: trie_split@src/trie.c:538: Assertion failed: `key_nibble != rep_nibble` and OOB accesses to trie leaf keys. Fix it by ignoring those extensions, since filenames cannot contain NUL bytes. Fixes: 08030aea ("color: Delay the case_sensitive decision")
* eval: Don't warn about suppressed errors without -noerrorTavian Barnes2024-08-191-0/+2
|
* tests/bfs: Add -noerror testsTavian Barnes2024-08-196-0/+21
|
* parse: Take umask into account in parse_mode()Tavian Barnes2024-08-021-2/+3
| | | | | | | POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1) here, so for modes like +rw,-x with no "who" specified, apply the umask. Link: https://www.austingroupbugs.net/view.php?id=1392
* tests: Add more files to perms/Tavian Barnes2024-08-021-0/+2
|
* tests/bfs: New case-sensitivity ordering testTavian Barnes2024-07-032-0/+28
|
* color: Delay the case_sensitive decisionTavian Barnes2024-07-022-0/+28
|
* tests: Improve color case insensitivity coverageTavian Barnes2024-06-052-6/+6
|
* tests: New inaccessible/ directory tree for permission errorsTavian Barnes2024-06-042-10/+2
|
* parse: Allow -Darg/-Sarg as well as -D arg / -S argTavian Barnes2024-06-036-0/+59
|
* parse: Handle multiple flags at once like -LEXO2Tavian Barnes2024-06-033-0/+19
| | | | | | | | | | | | | | | | | | | | | The POSIX Utility Syntax Guidelines specify that flag groups like -HL should be handled like -H -L. GNU find doesn't support grouping flags in this way, but BSD find does. To avoid conflicts with non-flag primaries, for now we require at least one flag in a group to be a capital letter. That is, we support things like -Lds but not -ds. We also do not support -fPATH (without a space) as it would conflict with -follow, -fprint, etc. It is impossible to be compatible with both GNU and BSD find here: user@gnu$ find -follow link link/file ... user@bsd$ find -follow find: ollow: No such file or directory Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
* tests: Add some more weird namesTavian Barnes2024-05-282-0/+16
|
* bfstd: Treat ELOOP like ENOENTTavian Barnes2024-05-271-1/+8
| | | | | | | GNU findutils just made the same change, so looping symlinks will be considered broken rather than a hard error. Link: https://savannah.gnu.org/bugs/?51926
* printf: The ' ' (space) flag must be numericTavian Barnes2024-05-191-0/+1
|
* Implement -limit NTavian Barnes2024-03-206-0/+9
| | | | Closes: https://github.com/tavianator/bfs/issues/133
* tests/bfs/D_opt: Don't rely on directory link countsTavian Barnes2024-02-282-12/+1
| | | | Fixes: https://github.com/tavianator/bfs/issues/131
* bftw: stat() files asynchronouslyTavian Barnes2024-02-061-1/+1
|
* tests: Don't clobber inherited FDsTavian Barnes2024-02-011-1/+1
| | | | | Rather than attempting to close any unexpected FDs, just count them and adjust our ulimit -n calls to account for them.
* tests/bfs/D_opt: New test for more -D opt coverageTavian Barnes2024-01-072-0/+19
|
* tests: Remove unneeded command -v unbuffer || skipTavian Barnes2024-01-012-4/+0
|
* parse: Reject integers that start with whitespaceTavian Barnes2023-12-091-0/+1
|
* Treat NO_COLOR="" the same as unsetTavian Barnes2023-11-062-0/+32
| | | | | | | | | | | | | | The docs say > Command-line software which adds ANSI color to its output by default > should check for a NO_COLOR environment variable that, when present > and not an empty string (regardless of its value), prevents the > addition of ANSI color. but we were not checking for the empty string. Link: https://no-color.org/ Link: https://github.com/sharkdp/fd/pull/1421
* tests/bfs/help: Fix exit statusTavian Barnes2023-10-231-4/+4
|
* tests/bfs/help: Use ... && fail instead of ! ...Tavian Barnes2023-10-231-4/+4
| | | | ! false doesn't trigger an error with set -e.
* tests/bfs/printf_color: Fix race conditionTavian Barnes2023-10-232-1/+2
| | | | | Invoking bfs in the top directory can lead it to explore other tests' scratch directories, so explicitly exclude them.
* tests: Fix Bash 3 compatibilityTavian Barnes2023-10-231-4/+2
|
* tests: Use test-specific scratch directoriesTavian Barnes2023-10-226-20/+17
|
* tests: Refactor implementation into separate filesTavian Barnes2023-10-191-2/+0
|
* tests: Move closed_std* tests out of the POSIX groupTavian Barnes2023-10-144-0/+28
| | | | | | | | | | | | | POSIX actually says > If the utility would be executed with file descriptor 0, 1, or 2 > closed, implementations may execute the utility with the file > descriptor open to an unspecified file. So we're not guaranteed to be able to detect the situation in the first place. Add a best-effort check for these platforms and skip the test. Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01_01
* tests/bfs/status: Try to test SIGWINCHTavian Barnes2023-10-061-1/+1
|
* tests: New bfs_pty wrapper for unbufferTavian Barnes2023-10-063-7/+3
|
* tests/bfs: Add a test that runs -statusTavian Barnes2023-10-051-0/+3
|
* tests/bfs: Add tests for color autodetectionTavian Barnes2023-10-054-0/+65
|
* color: Only highlight the trailing slash on ENOTDIRTavian Barnes2023-07-132-5/+5
|
* color: Don't break up leading and trailing dirsTavian Barnes2023-07-1339-61/+63
|
* color: TTY-escape filenamesTavian Barnes2023-07-1338-0/+76
|
* color: Get rid of EXT_MAXTavian Barnes2023-07-132-0/+23
|
* parse: Reject -j0Tavian Barnes2023-07-121-0/+1
|
* tests/bfs: Add tests for -jTavian Barnes2023-07-125-0/+41
|
* color: Compare values too when deciding to smart-caseTavian Barnes2023-06-302-2/+7
|
* color: Implement smart casingTavian Barnes2023-06-295-10/+12
| | | | | | | | | Since coreutils 9.2, ls does case-sensitive extension matching if the same extension is capitalized differently in $LS_COLORS. Implement the same logic. Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33123 Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=9086
* tests/bfs/color: Add mixed-case extensionsTavian Barnes2023-06-2938-114/+304
|
* color: `fi=0` should not fall back to `no`Tavian Barnes2023-06-088-0/+84
|
* tests: Use bfs_sudo wrapper instead of testing $SUDOTavian Barnes2022-12-292-4/+2
|
* tests/bfs/printf_everything: Simplify double negationTavian Barnes2022-12-161-2/+2
|
* tests: Fail early in bfs_diff if the diff failsTavian Barnes2022-12-161-1/+1
| | | | Otherwise, propagate the exit code from bfs
* tests: Print the skip reason for --verbose=skippedTavian Barnes2022-12-161-4/+1
|
* tests: Turn on set -eTavian Barnes2022-12-164-12/+9
|
* tests: Move crash detection into invoke_bfs, use ! instead of failTavian Barnes2022-12-1631-32/+32
|