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 "errors" | 8 "errors" |
9 "io/ioutil" | 9 "io/ioutil" |
10 "os" | 10 "os" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 {`c:\`, `c:\`}, | 684 {`c:\`, `c:\`}, |
685 } | 685 } |
686 | 686 |
687 // simpleJoin builds a file name from the directory and path. | 687 // simpleJoin builds a file name from the directory and path. |
688 // It does not use Join because we don't want ".." to be evaluated. | 688 // It does not use Join because we don't want ".." to be evaluated. |
689 func simpleJoin(dir, path string) string { | 689 func simpleJoin(dir, path string) string { |
690 return dir + string(filepath.Separator) + path | 690 return dir + string(filepath.Separator) + path |
691 } | 691 } |
692 | 692 |
693 func TestEvalSymlinks(t *testing.T) { | 693 func TestEvalSymlinks(t *testing.T) { |
694 » if runtime.GOOS == "plan9" { | 694 » switch runtime.GOOS { |
695 » » t.Skip("Skipping test: symlinks don't exist under Plan 9") | 695 » case "nacl", "plan9": |
| 696 » » t.Skipf("skipping on %s", runtime.GOOS) |
696 } | 697 } |
697 | 698 |
698 tmpDir, err := ioutil.TempDir("", "evalsymlink") | 699 tmpDir, err := ioutil.TempDir("", "evalsymlink") |
699 if err != nil { | 700 if err != nil { |
700 t.Fatal("creating temp dir:", err) | 701 t.Fatal("creating temp dir:", err) |
701 } | 702 } |
702 defer os.RemoveAll(tmpDir) | 703 defer os.RemoveAll(tmpDir) |
703 | 704 |
704 // /tmp may itself be a symlink! Avoid the confusion, although | 705 // /tmp may itself be a symlink! Avoid the confusion, although |
705 // it means trusting the thing we're testing. | 706 // it means trusting the thing we're testing. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 t.Fatal("filepath.Walk out of order - ken before
bugs") | 1008 t.Fatal("filepath.Walk out of order - ken before
bugs") |
1008 } | 1009 } |
1009 seenKen = true | 1010 seenKen = true |
1010 } | 1011 } |
1011 return nil | 1012 return nil |
1012 }) | 1013 }) |
1013 if !seenKen { | 1014 if !seenKen { |
1014 t.Fatalf("%q not seen", ken) | 1015 t.Fatalf("%q not seen", ken) |
1015 } | 1016 } |
1016 } | 1017 } |
LEFT | RIGHT |