diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-05 21:07:41 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-05-05 21:07:41 +0000 |
commit | e649551e8e86dfca2a43cffcb7c11c844d822227 (patch) | |
tree | 307ea3a46f36780aa390596c7a8329ddbc327718 | |
parent | 00a7564ac5a4bc8e5158275f5aeac54315eacd85 (diff) | |
download | busybox-w32-e649551e8e86dfca2a43cffcb7c11c844d822227.tar.gz busybox-w32-e649551e8e86dfca2a43cffcb7c11c844d822227.tar.bz2 busybox-w32-e649551e8e86dfca2a43cffcb7c11c844d822227.zip |
New test from Natanael Copa.
git-svn-id: svn://busybox.net/trunk/busybox@15015 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | testsuite/readlink.tests | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/readlink.tests b/testsuite/readlink.tests new file mode 100644 index 000000000..5483d9772 --- /dev/null +++ b/testsuite/readlink.tests | |||
@@ -0,0 +1,29 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Readlink tests. | ||
4 | # Copyright 2006 by Natanael Copa <n@tanael.org> | ||
5 | # Licensed under GPL v2, see file LICENSE for details. | ||
6 | |||
7 | . testing.sh | ||
8 | |||
9 | TESTDIR=readlink_testdir | ||
10 | TESTFILE="$TESTDIR/testfile" | ||
11 | TESTLINK="testlink" | ||
12 | FAILLINK="$TESTDIR/$TESTDIR/testlink" | ||
13 | |||
14 | # create the dir and test files | ||
15 | mkdir -p "./$TESTDIR" | ||
16 | touch "./$TESTFILE" | ||
17 | ln -s "./$TESTFILE" "./$TESTLINK" | ||
18 | |||
19 | testing "readlink on a file" "readlink ./$TESTFILE" "" "" "" | ||
20 | testing "readlink on a link" "readlink ./$TESTLINK" "./$TESTFILE\n" "" "" | ||
21 | testing "readlink -f on a file" "readlink -f ./$TESTFILE" "$PWD/$TESTFILE\n" "" "" | ||
22 | testing "readlink -f on a link" "readlink -f ./$TESTLINK" "$PWD/$TESTFILE\n" "" "" | ||
23 | testing "readlink -f on an invalid link" "readlink -f ./$FAILLINK" "" "" "" | ||
24 | testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$TESTFILE\n" "" "" | ||
25 | |||
26 | |||
27 | # clean up | ||
28 | rm -r "$TESTLINK" "$TESTDIR" | ||
29 | |||