From 01a754bc5572103f9a49242d756dc04b0e86bb6e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 12 Aug 2017 16:23:43 -0400 Subject: tests: Add a test for -exec ... {} + with a failing command --- tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index cf9e1a3..88e93b1 100755 --- a/tests.sh +++ b/tests.sh @@ -187,6 +187,7 @@ posix_tests=( test_size_bytes test_exec test_exec_plus + test_exec_plus_status test_exec_plus_semicolon test_flag_comma test_perm_222 @@ -779,6 +780,13 @@ function test_exec_plus() { bfs_diff basic -exec "$TESTS/sort-args.sh" '{}' + } +function test_exec_plus_status() { + # -exec ... {} + should always return true, but if the command fails, bfs + # should exit with a non-zero status + bfs_diff basic -exec false '{}' + -print + ! invoke_bfs basic -exec false '{}' + +} + function test_exec_plus_semicolon() { # POSIX says: # Only a that immediately follows an argument containing only the two characters "{}" -- cgit v1.2.3