summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/reverse/correctness_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/reverse/correctness_test.go b/tests/reverse/correctness_test.go
index 77a440b..40bd320 100644
--- a/tests/reverse/correctness_test.go
+++ b/tests/reverse/correctness_test.go
@@ -28,3 +28,24 @@ func TestLongnameStat(t *testing.T) {
test_helpers.VerifySize(t, path, 10)
*/
}
+
+func TestSymlinks(t *testing.T) {
+ target := "/"
+ os.Symlink(target, dirA+"/symlink")
+ cSymlink := dirC + "/symlink"
+ _, err := os.Lstat(cSymlink)
+ if err != nil {
+ t.Errorf("Lstat: %v", err)
+ }
+ _, err = os.Stat(cSymlink)
+ if err != nil {
+ t.Errorf("Stat: %v", err)
+ }
+ actualTarget, err := os.Readlink(cSymlink)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if target != actualTarget {
+ t.Errorf("wrong symlink target: want=%q have=%q", target, actualTarget)
+ }
+}