Commit 64773fdebbd1384548293154978d3e6e3f2e66ba

Stefan Sperling 2020-07-23T14:21:27

expand test cases in test_rm_symlink

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