summaryrefslogtreecommitdiff
path: root/tests/ln
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-12-24 13:49:29 +0000
committerJim Meyering <jim@meyering.net>2000-12-24 13:49:29 +0000
commit2cea3f1b14bb2344da63367514e458a09b3d42c4 (patch)
tree18f2ea1d57d4e92bf858995d9b12fb1adc7967ca /tests/ln
parent73a15b2b5f558a234138e268dd3db7fae47a2faf (diff)
downloadcoreutils-2cea3f1b14bb2344da63367514e458a09b3d42c4.tar.xz
detect ln simple backup bug
Diffstat (limited to 'tests/ln')
-rwxr-xr-xtests/ln/misc17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/ln/misc b/tests/ln/misc
index d4d7fbfaf..26db832ec 100755
--- a/tests/ln/misc
+++ b/tests/ln/misc
@@ -1,17 +1,19 @@
#!/bin/sh
-tmp=t2-ln.$$
-
if test "$VERBOSE" = yes; then
set -x
ln --version
fi
+pwd=`pwd`
+tmp=t2-ln.$$
+trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
+trap '(exit $?); exit' 1 2 13 15
+
framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
-
t=tln-symlink
d=tln-subdir
ld=tln-symlink-to-subdir
@@ -113,8 +115,13 @@ fi
rm -rf a symlink hard-to-sym hard-to-dangle
# ===================================================
-cd ..
-../../src/rm -rf $tmp
+# Make sure ln can make simple backups.
+# This was fixed in 4.0.34. Broken in 4.0r.
+touch a || framework_failure=1
+ln --backup=simple --suffix=.orig x a || fail=1
+test -f a.orig || fail=1
+
+# ===================================================
if test $framework_failure = 1; then
echo 'failure in testing framework' 1>&2