]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: sync: check that all files are processed even when errors occur
authorCollin Funk <collin.funk1@gmail.com>
Sun, 18 Jan 2026 23:18:18 +0000 (15:18 -0800)
committerCollin Funk <collin.funk1@gmail.com>
Mon, 19 Jan 2026 19:08:48 +0000 (11:08 -0800)
* tests/misc/sync.sh: Add the test case.

tests/misc/sync.sh

index dcf12e55edef9aa0d17966adcef55a9984b13a35..fa2ca86fa6a8470e850107269f49474aed667181 100755 (executable)
@@ -38,6 +38,14 @@ sync file || fail=1
 # Ensure multiple args are processed and diagnosed
 returns_ 1 sync file nofile || fail=1
 
+# Ensure all arguments a processed even if one results in an error
+returns_ 1 sync nofile1 file nofile2 2>err || fail=1
+cat <<\EOF > exp || framework_failure_
+sync: error opening 'nofile1': No such file or directory
+sync: error opening 'nofile2': No such file or directory
+EOF
+compare exp err || fail=1
+
 # Ensure inaccessible dirs give an appropriate error
 mkdir norw || framework_failure_
 chmod 0 norw || framework_failure_