From 8dce57e169255608b46bb563bb7de1581908aea6 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Nov 2011 12:04:16 -0500 Subject: os: new FileInfo, FileMode types + update tree R=golang-dev, r, r, gri, bradfitz, iant, iant, nigeltao, n13m3y3r CC=golang-dev https://golang.org/cl/5416060 --- src/pkg/path/filepath/path_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/pkg/path/filepath/path_test.go') diff --git a/src/pkg/path/filepath/path_test.go b/src/pkg/path/filepath/path_test.go index 983cc85c8e..fab5adc102 100644 --- a/src/pkg/path/filepath/path_test.go +++ b/src/pkg/path/filepath/path_test.go @@ -318,7 +318,7 @@ func checkMarks(t *testing.T, report bool) { // Assumes that each node name is unique. Good enough for a test. // If clear is true, any incoming error is cleared before return. The errors // are always accumulated, though. -func mark(path string, info *os.FileInfo, err error, errors *[]error, clear bool) error { +func mark(path string, info os.FileInfo, err error, errors *[]error, clear bool) error { if err != nil { *errors = append(*errors, err) if clear { @@ -326,8 +326,9 @@ func mark(path string, info *os.FileInfo, err error, errors *[]error, clear bool } return err } + name := info.Name() walkTree(tree, tree.name, func(path string, n *Node) { - if n.name == info.Name { + if n.name == name { n.mark++ } }) @@ -338,7 +339,7 @@ func TestWalk(t *testing.T) { makeTree(t) errors := make([]error, 0, 10) clear := true - markFn := func(path string, info *os.FileInfo, err error) error { + markFn := func(path string, info os.FileInfo, err error) error { return mark(path, info, err, &errors, clear) } // Expect no errors. @@ -600,7 +601,7 @@ func TestAbs(t *testing.T) { t.Errorf("Abs(%q) error: %v", path, err) } absinfo, err := os.Stat(abspath) - if err != nil || absinfo.Ino != info.Ino { + if err != nil || !absinfo.(*os.FileStat).SameFile(info.(*os.FileStat)) { t.Errorf("Abs(%q)=%q, not the same file", path, abspath) } if !filepath.IsAbs(abspath) { -- cgit v1.3