expand test cases in test_rm_symlink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/regress/cmdline/rm.sh b/regress/cmdline/rm.sh
index 6a7dff9..2ecf384 100755
--- a/regress/cmdline/rm.sh
+++ b/regress/cmdline/rm.sh
@@ -410,8 +410,10 @@ function test_rm_symlink {
(cd $testroot/repo && ln -s alpha alpha.link)
(cd $testroot/repo && ln -s epsilon epsilon.link)
(cd $testroot/repo && ln -s /etc/passwd passwd.link)
+ (cd $testroot/repo && ln -s ../beta epsilon/beta.link)
+ (cd $testroot/repo && ln -s nonexistent nonexistent.link)
(cd $testroot/repo && git add .)
- git_commit $testroot/repo -m "add a symlink"
+ git_commit $testroot/repo -m "add symlinks"
got checkout $testroot/repo $testroot/wt > /dev/null
ret="$?"
@@ -423,18 +425,17 @@ function test_rm_symlink {
echo 'D alpha.link' > $testroot/stdout.expected
echo 'D epsilon.link' >> $testroot/stdout.expected
echo 'D passwd.link' >> $testroot/stdout.expected
- (cd $testroot/wt && got rm alpha.link epsilon.link passwd.link > \
- $testroot/stdout)
+ echo 'D epsilon/beta.link' >> $testroot/stdout.expected
+ echo 'D nonexistent.link' >> $testroot/stdout.expected
+ (cd $testroot/wt && got rm alpha.link epsilon.link passwd.link \
+ epsilon/beta.link nonexistent.link > $testroot/stdout)
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
diff -u $testroot/stdout.expected $testroot/stdout
- test_done "$testroot" "$ret"
- return 1
fi
test_done "$testroot" "$ret"
-
}
run_test test_rm_basic