summaryrefslogtreecommitdiffstats
path: root/testsuite/trimslash.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 16:14:31 +0000
commit2d5707c7479eacb3b1ad98e01b53f56a88f8fb78 (patch)
treed9c334e83692851c02e3e1b8e65570c97bc82481 /testsuite/trimslash.test
parentInitial commit. (diff)
downloadrsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.tar.xz
rsync-2d5707c7479eacb3b1ad98e01b53f56a88f8fb78.zip
Adding upstream version 3.2.7.upstream/3.2.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testsuite/trimslash.test')
-rw-r--r--testsuite/trimslash.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/trimslash.test b/testsuite/trimslash.test
new file mode 100644
index 0000000..2efaa07
--- /dev/null
+++ b/testsuite/trimslash.test
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Copyright (C) 2002 by Martin Pool <mbp@samba.org>
+
+# This program is distributable under the terms of the GNU GPL (see
+# COPYING).
+
+# Test tiny function to trim trailing slashes.
+
+. "$suitedir/rsync.fns"
+
+"$TOOLDIR/trimslash" "/usr/local/bin" "/usr/local/bin/" "/usr/local/bin///" \
+ "//a//" "////" \
+ "/Users/Weird Macintosh Name/// Ooh, translucent plastic/" \
+ > "$scratchdir/slash.out"
+diff $diffopt "$scratchdir/slash.out" - <<EOF
+/usr/local/bin
+/usr/local/bin
+/usr/local/bin
+//a
+/
+/Users/Weird Macintosh Name/// Ooh, translucent plastic
+EOF
+
+# The script would have aborted on error, so getting here means we've won.
+exit 0