LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package filepath_test | 5 package filepath_test |
6 | 6 |
7 import ( | 7 import ( |
8 "os" | 8 "os" |
9 "path/filepath" | 9 "path/filepath" |
10 "reflect" | 10 "reflect" |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 tests = append(tests, d) | 628 tests = append(tests, d) |
629 } | 629 } |
630 } | 630 } |
631 testEvalSymlinks(t, tests) | 631 testEvalSymlinks(t, tests) |
632 } | 632 } |
633 | 633 |
634 // Test paths relative to $GOROOT/src | 634 // Test paths relative to $GOROOT/src |
635 var abstests = []string{ | 635 var abstests = []string{ |
636 "../AUTHORS", | 636 "../AUTHORS", |
637 "pkg/../../AUTHORS", | 637 "pkg/../../AUTHORS", |
638 » "Make.pkg", | 638 » "Make.inc", |
639 » "pkg/Makefile", | 639 » "pkg/math", |
640 ".", | 640 ".", |
641 » "$GOROOT/src/Make.pkg", | 641 » "$GOROOT/src/Make.inc", |
642 » "$GOROOT/src/../src/Make.pkg", | 642 » "$GOROOT/src/../src/Make.inc", |
643 "$GOROOT/misc/cgo", | 643 "$GOROOT/misc/cgo", |
644 "$GOROOT", | 644 "$GOROOT", |
645 } | 645 } |
646 | 646 |
647 func TestAbs(t *testing.T) { | 647 func TestAbs(t *testing.T) { |
648 oldwd, err := os.Getwd() | 648 oldwd, err := os.Getwd() |
649 if err != nil { | 649 if err != nil { |
650 t.Fatal("Getwd failed: " + err.Error()) | 650 t.Fatal("Getwd failed: " + err.Error()) |
651 } | 651 } |
652 defer os.Chdir(oldwd) | 652 defer os.Chdir(oldwd) |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 func TestVolumeName(t *testing.T) { | 790 func TestVolumeName(t *testing.T) { |
791 if runtime.GOOS != "windows" { | 791 if runtime.GOOS != "windows" { |
792 return | 792 return |
793 } | 793 } |
794 for _, v := range volumenametests { | 794 for _, v := range volumenametests { |
795 if vol := filepath.VolumeName(v.path); vol != v.vol { | 795 if vol := filepath.VolumeName(v.path); vol != v.vol { |
796 t.Errorf("VolumeName(%q)=%q, want %q", v.path, vol, v.vo
l) | 796 t.Errorf("VolumeName(%q)=%q, want %q", v.path, vol, v.vo
l) |
797 } | 797 } |
798 } | 798 } |
799 } | 799 } |
LEFT | RIGHT |