From 06291f17412f4df85c60e8efc200530f733fe10c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 6 Jul 2004 16:14:40 +0000 Subject: renamed from ../misc/readline --- tests/readlink/rl-1 | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 tests/readlink/rl-1 (limited to 'tests/readlink') diff --git a/tests/readlink/rl-1 b/tests/readlink/rl-1 new file mode 100755 index 000000000..6ebbe923e --- /dev/null +++ b/tests/readlink/rl-1 @@ -0,0 +1,54 @@ +#!/bin/sh +# test for readlink mode. + +if test "$VERBOSE" = yes; then + set -x + readlink --version +fi + +pwd=`pwd` +t0=`echo "$0" |sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0 +trap 'status=$?; (exit $status); exit $status' 1 2 13 15 + +fail=1 +while :; do + mkdir -p $tmp || break + cd $tmp || break + + mkdir subdir || break + touch regfile || break + ln -s regfile link1 || break + ln -s missing link2 || break + + fail=0 + break +done + +if test $fail = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=1 +while :; do + v=`readlink link1` || break + test "$v" = regfile || break + + v=`readlink link2` || break + test "$v" = missing || break + + v=`readlink subdir` && break + test -z "$v" || break + + v=`readlink regfile` && break + test -z "$v" || break + + v=`readlink missing` && break + test -z "$v" || break + + fail=0 + break +done + +(exit $fail); exit $fail -- cgit v1.2.3-70-g09d2