summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-05-08 11:58:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-09-15 13:56:20 -0400
commitb6b7a68190703d30912d2a1c3d8d64e3de81a612 (patch)
treed99e0b9dd0060deed2980b43a99fd2f359f9ad30 /tests.sh
parentb2d85ea84c930ebcfefc6449414ed64cd80e2f89 (diff)
downloadbfs-b6b7a68190703d30912d2a1c3d8d64e3de81a612.tar.xz
Implement -files0-from FILE
See https://savannah.gnu.org/bugs/?60383 for the development of the corresponding GNU find feature.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index 48fec87..46debd9 100755
--- a/tests.sh
+++ b/tests.sh
@@ -503,6 +503,14 @@ gnu_tests=(
test_false
+ test_files0_from_file
+ test_files0_from_stdin
+ test_files0_from_none
+ test_files0_from_empty
+ test_files0_from_nowhere
+ test_files0_from_nothing
+ test_files0_from_ok
+
test_fls
test_follow
@@ -2999,6 +3007,35 @@ function test_flags() {
bfs_diff scratch -flags -offline,nohidden
}
+function test_files0_from_file() {
+ invoke_bfs basic -fprint0 scratch/files0.in
+ bfs_diff -files0-from scratch/files0.in
+}
+
+function test_files0_from_stdin() {
+ invoke_bfs basic -print0 | bfs_diff -files0-from -
+}
+
+function test_files0_from_none() {
+ ! printf "" | quiet invoke_bfs -files0-from -
+}
+
+function test_files0_from_empty() {
+ ! printf "\0" | quiet invoke_bfs -files0-from -
+}
+
+function test_files0_from_nowhere() {
+ ! quiet invoke_bfs -files0-from
+}
+
+function test_files0_from_nothing() {
+ ! quiet invoke_bfs -files0-from basic/nonexistent
+}
+
+function test_files0_from_ok() {
+ ! printf "basic\0" | quiet invoke_bfs -files0-from - -ok echo {} \;
+}
+
BOL=
EOL='\n'