From: Martin Pool Date: Mon, 8 Apr 2002 04:47:01 +0000 (+0000) Subject: A test suite that calls unsafe_symlink() directly to see how it X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/d25c0e42c72f2399b44b0c666fc823daa9874521?hp=0ecfbf27c3b9e01d498201e90e7d0a89a9d0a47c A test suite that calls unsafe_symlink() directly to see how it handles different strings. --- diff --git a/testsuite/unsafe-byname.test b/testsuite/unsafe-byname.test new file mode 100644 index 00000000..2c199720 --- /dev/null +++ b/testsuite/unsafe-byname.test @@ -0,0 +1,20 @@ +#! /bin/sh + +# Copyright (C) 2002 by Martin Pool + +# Call directly into unsafe_symlink and test its handling of various filenames + +. $srcdir/testsuite/rsync.fns + +test_unsafe() { + result=`"$TOOLDIR/t_unsafe" "$1" "$2"` || test_fail "Failed to check $1 $2" + if [ "$result" != "$3" ] + then + test_fail "t_unsafe $1 $2 returned \"$result\", expected \"$3\"" + fi +} + +set -x + +test_unsafe foo foo safe +test_unsafe ../foo foo unsafe