From 1fe2438dd99b0355ed75991067ff201ec81910fc Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 23 Jun 2018 17:59:04 -0400 Subject: tests: New test for -depth in the presence of read errors --- tests.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 16750b6..8f0f72c 100755 --- a/tests.sh +++ b/tests.sh @@ -176,6 +176,7 @@ posix_tests=( test_depth_mindepth_2 test_depth_maxdepth_1 test_depth_maxdepth_2 + test_depth_error test_name test_name_root test_name_root_depth @@ -620,6 +621,23 @@ function test_depth_maxdepth_2() { bfs_diff basic -maxdepth 2 -depth } +function test_depth_error() { + rm -rf scratch/* + touchp scratch/foo/bar + touchp scratch/baz/qux + chmod -r scratch/foo + chmod -x scratch/baz + + bfs_diff scratch -depth 2>/dev/null + local ret=$? + + chmod +r scratch/foo + chmod +x scratch/baz + rm -rf scratch/* + + return $ret +} + function test_name() { bfs_diff basic -name '*f*' } -- cgit v1.2.3