LEFT | RIGHT |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 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 main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "runtime" | 8 "runtime" |
9 "testing" | 9 "testing" |
10 ) | 10 ) |
11 | 11 |
12 func TestLatestVersion(t *testing.T) { | 12 func TestLatestVersion(t *testing.T) { |
13 » goroot = runtime.GOROOT() | 13 » goroot := &Repo{Path: runtime.GOROOT()} |
14 » v, err := latestVersion() | 14 » v, err := latestVersion(goroot) |
15 if err != nil { | 15 if err != nil { |
16 t.Fatal(err) | 16 t.Fatal(err) |
17 } | 17 } |
18 if v != builderVersion { | 18 if v != builderVersion { |
19 t.Errorf("got %v, want %v", v, builderVersion) | 19 t.Errorf("got %v, want %v", v, builderVersion) |
20 } | 20 } |
21 } | 21 } |
LEFT | RIGHT |