bc: partially rewrite parser, tests pass, ^C might be broken now
[oweals/busybox.git] / testsuite / readlink.tests
index e6822dff1023915648ebe804f67e61fb1574e743..27b52f6c4b025e1c0b773bd184f531570bfdbb50 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Readlink tests.
 # Copyright 2006 by Natanael Copa <n@tanael.org>
-# Licensed under GPL v2, see file LICENSE for details.
+# Licensed under GPLv2, see file LICENSE in this source tree.
 
 . ./testing.sh
 
@@ -21,12 +21,18 @@ testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" ""
 
 optional FEATURE_READLINK_FOLLOW
 
-testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" ""
-testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" ""
+# shell's $PWD may leave symlinks unresolved.
+# "pwd" may be a built-in and have the same problem.
+# External pwd _can't_ have that problem (current dir on Unix is physical).
+pwd=`which pwd`
+pwd=`$pwd`
+testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$pwd/$TESTFILE\n" "" ""
+testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$pwd/$TESTFILE\n" "" ""
 testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" ""
-testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$TESTFILE\n" "" ""
+testing "readlink -f on a weird dir" "readlink -f $TESTDIR/../$TESTFILE" "$pwd/$TESTFILE\n" "" ""
 
 
 # clean up
 rm -r "$TESTLINK" "$TESTDIR"
 
+exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))