summaryrefslogtreecommitdiff
path: root/libgo/go/path/filepath/path_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/path/filepath/path_test.go')
-rw-r--r--libgo/go/path/filepath/path_test.go32
1 files changed, 30 insertions, 2 deletions
diff --git a/libgo/go/path/filepath/path_test.go b/libgo/go/path/filepath/path_test.go
index 4d5e3bdcb6d..9c3f287ecbd 100644
--- a/libgo/go/path/filepath/path_test.go
+++ b/libgo/go/path/filepath/path_test.go
@@ -843,7 +843,7 @@ func TestEvalSymlinks(t *testing.T) {
if p, err := filepath.EvalSymlinks(path); err != nil {
t.Errorf("EvalSymlinks(%q) error: %v", d.path, err)
} else if filepath.Clean(p) != filepath.Clean(dest) {
- t.Errorf("Clean(%q)=%q, want %q", path, p, dest)
+ t.Errorf("EvalSymlinks(%q)=%q, want %q", path, p, dest)
}
// test EvalSymlinks(".")
@@ -875,6 +875,34 @@ func TestEvalSymlinks(t *testing.T) {
t.Errorf(`EvalSymlinks(".") in %q directory returns %q, want "." or %q`, d.path, p, want)
}()
+ // test EvalSymlinks(".."+path)
+ func() {
+ defer func() {
+ err := os.Chdir(wd)
+ if err != nil {
+ t.Fatal(err)
+ }
+ }()
+
+ err := os.Chdir(simpleJoin(tmpDir, "test"))
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ path := simpleJoin("..", d.path)
+ dest := simpleJoin("..", d.dest)
+ if filepath.IsAbs(d.dest) || os.IsPathSeparator(d.dest[0]) {
+ dest = d.dest
+ }
+
+ if p, err := filepath.EvalSymlinks(path); err != nil {
+ t.Errorf("EvalSymlinks(%q) error: %v", d.path, err)
+ } else if filepath.Clean(p) != filepath.Clean(dest) {
+ t.Errorf("EvalSymlinks(%q)=%q, want %q", path, p, dest)
+ }
+ }()
+
// test EvalSymlinks where parameter is relative path
func() {
defer func() {
@@ -892,7 +920,7 @@ func TestEvalSymlinks(t *testing.T) {
if p, err := filepath.EvalSymlinks(d.path); err != nil {
t.Errorf("EvalSymlinks(%q) error: %v", d.path, err)
} else if filepath.Clean(p) != filepath.Clean(d.dest) {
- t.Errorf("Clean(%q)=%q, want %q", d.path, p, d.dest)
+ t.Errorf("EvalSymlinks(%q)=%q, want %q", d.path, p, d.dest)
}
}()
}