Fix remove_nonempty_directory test bug

Wrap the attempt to rmdir in an if statement, otherwise the entire
test process exists (errexit is set). This test expects the rmdir
to fail.
This commit is contained in:
Robb Kistler 2015-09-11 12:53:22 -07:00
parent 849e66f6a1
commit dac9844765

View File

@ -261,7 +261,10 @@ function test_remove_nonempty_directory {
echo "Testing removing a non-empty directory"
mk_test_dir
touch "${TEST_DIR}/file"
rmdir "${TEST_DIR}" 2>&1 | grep -q "Directory not empty"
if ! (rmdir "${TEST_DIR}" 2>&1 | grep -q "Directory not empty"); then
echo "Did not get \"Directory not empty\""
exit 1
fi
rm "${TEST_DIR}/file"
rm_test_dir
}