summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2021-10-19 12:24:22 -0400
committerTavian Barnes <tavianator@tavianator.com>2021-10-19 12:28:17 -0400
commit9b50adaaaa4fedc8bda6fcf32595ecf7a682fa8b (patch)
tree3ed5f7cbdc1063b8e5c6d9f9a5ac5ea2542e1250 /tests.sh
parentdceb5658eae528ae18dbd7d249ab4ca60b3958fe (diff)
downloadbfs-9b50adaaaa4fedc8bda6fcf32595ecf7a682fa8b.tar.xz
parse: Switch back to O_TRUNC from explicit ftruncate()
O_TRUNC is not equivalent to an unconditional ftruncate(), e.g. for device files. This reverts the behaviour change from 78944c81, which was never released and is not supported in other find implementations.
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh24
1 files changed, 9 insertions, 15 deletions
diff --git a/tests.sh b/tests.sh
index 2580d2f..c488aec 100755
--- a/tests.sh
+++ b/tests.sh
@@ -524,6 +524,7 @@ gnu_tests=(
test_fprint
test_fprint_duplicate
test_fprint_error
+ test_fprint_noerror
test_fprint_noarg
test_fprint_nonexistent
test_fprint_truncate
@@ -736,7 +737,6 @@ bfs_tests=(
test_execdir_plus
- test_fprint_append
test_fprint_duplicate_stdout
test_fprint_error_stdout
test_fprint_error_stderr
@@ -1796,20 +1796,6 @@ function test_fprint_truncate() {
fi
}
-function test_fprint_append() {
- rm -f scratch/test_fprint_append.out
-
- invoke_bfs basic -fprint scratch/test_fprint_append.out >>scratch/test_fprint_append.out
- invoke_bfs basic -fprint scratch/test_fprint_append.out >>scratch/test_fprint_append.out
- sort -o scratch/test_fprint_append.out scratch/test_fprint_append.out
-
- if [ "$UPDATE" ]; then
- cp {scratch,"$TESTS"}/test_fprint_append.out
- else
- diff -u {"$TESTS",scratch}/test_fprint_append.out
- fi
-}
-
function test_double_dash() {
cd basic
bfs_diff -- . -type f
@@ -2724,6 +2710,14 @@ function test_fprint_error() {
fi
}
+function test_fprint_noerror() {
+ # Regression test: /dev/full should not fail until actually written to
+
+ if [ -e /dev/full ]; then
+ invoke_bfs basic -false -fprint /dev/full
+ fi
+}
+
function test_fprint_error_stdout() {
if [ -e /dev/full ]; then
fail quiet invoke_bfs basic -maxdepth 0 -fprint /dev/full >/dev/full