aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2015-01-22 10:40:50 +1100
committerAlex Brainman <alex.brainman@gmail.com>2015-01-23 05:30:55 +0000
commit2ef5a0d23bc4e07573bb094b97e96c9cd9844fca (patch)
tree17f525bfee35f4fc100b276cfc6e79c609022649 /go
parent96af1504f60193ba43510e8d515cc0ad6cac5c5c (diff)
downloadtools-2ef5a0d23bc4e07573bb094b97e96c9cd9844fca.tar.gz
refactor/rename: make tests pass on windows (fixes build)
- use import path not file path in go/buildutil.FakeContext OpenFile; - use regexp to compare error messages in TestErrors, because they contain windows file paths; - use OS file path (not unix path), when checking move results in TestMoves. Change-Id: Ib62d344acb551fb612d8a0773ae1ab5f18341294 Reviewed-on: https://go-review.googlesource.com/3171 Reviewed-by: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'go')
-rw-r--r--go/buildutil/fakecontext.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/go/buildutil/fakecontext.go b/go/buildutil/fakecontext.go
index 79c5a1b..24cbcbe 100644
--- a/go/buildutil/fakecontext.go
+++ b/go/buildutil/fakecontext.go
@@ -67,8 +67,8 @@ func FakeContext(pkgs map[string]map[string]string) *build.Context {
}
ctxt.OpenFile = func(filename string) (io.ReadCloser, error) {
filename = clean(filename)
- dir, base := filepath.Split(filename)
- content, ok := pkgs[filepath.Clean(dir)][base]
+ dir, base := path.Split(filename)
+ content, ok := pkgs[path.Clean(dir)][base]
if !ok {
return nil, fmt.Errorf("file not found: %s", filename)
}