Some more testing based on Matt's recent patch.
[rsync/rsync.git] / testsuite / delete.test
index 99791d5..00e3614 100644 (file)
@@ -2,7 +2,7 @@
 
 # Copyright (C) 2005 by Wayne Davison <wayned@samba.org>
 
-# This program is distributable under the terms of the GNU GPL see
+# This program is distributable under the terms of the GNU GPL (see
 # COPYING).
 
 # Test rsync handling of various delete directives.  
@@ -23,5 +23,19 @@ checkit "$RSYNC -avv --remove-sent-files \
 
 diff -r "$chkdir/empty" "$fromdir"
 
+# Make sure that "P" but not "-" per-dir merge-file filters take effect with
+# --delete-excluded.
+cat >"$todir/filters" <<EOF
+P foo
+- bar
+EOF
+touch "$todir/foo" "$todir/bar" "$todir/baz"
+
+$RSYNC -r --exclude=baz --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
+
+test -f "$todir/foo" || test_fail "rsync deleted $todir/foo"
+test -f "$todir/bar" && test_fail "rsync did not delete $todir/bar"
+test -f "$todir/baz" && test_fail "rsync did not delete $todir/baz"
+
 # The script would have aborted on error, so getting here means we've won.
 exit 0