Change-Id: I02b42abcc29ee04c8f54dc8ba2c6079b3e6c4153
Reviewed-on: https://go-review.googlesource.com/18816
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Robert Griesemer 2016-01-21 13:59:03 -08:00
Родитель abfa4875c0
Коммит d2e00652ba
4 изменённых файлов: 0 добавлений и 47 удалений

Просмотреть файл

@ -1,14 +0,0 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Incomplete source tree on Android.
// +build !android
// +build go1.6
package buildutil_test
func init() {
go16 = true
}

Просмотреть файл

@ -18,8 +18,6 @@ import (
"golang.org/x/tools/go/buildutil"
)
var go16 bool // Go version >= go1.6
func TestContainingPackage(t *testing.T) {
// unvirtualized:
goroot := runtime.GOROOT()
@ -32,13 +30,6 @@ func TestContainingPackage(t *testing.T) {
{gopath + "/src/golang.org/x/tools/go/buildutil/util_test.go",
"golang.org/x/tools/go/buildutil"},
}
// TODO(adonovan): simplify after Go 1.6.
if go16 {
tests = append(tests, [2]string{
gopath + "/src/vendor/golang.org/x/net/http2/hpack/hpack.go",
"vendor/golang.org/x/net/http2/hpack",
})
}
for _, test := range tests {
file, want := test[0], test[1]
bp, err := buildutil.ContainingPackage(&build.Default, ".", file)

Просмотреть файл

@ -1,12 +0,0 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !android
// +build go1.6
package importgraph_test
func init() {
go16 = true
}

Просмотреть файл

@ -9,10 +9,8 @@
package importgraph_test
import (
"fmt"
"go/build"
"sort"
"strings"
"testing"
"golang.org/x/tools/refactor/importgraph"
@ -22,8 +20,6 @@ import (
const this = "golang.org/x/tools/refactor/importgraph"
var go16 bool // Go version >= go1.6
func TestBuild(t *testing.T) {
forward, reverse, errors := importgraph.Build(&build.Default)
@ -49,14 +45,6 @@ func TestBuild(t *testing.T) {
}
}
// Test vendor packages appear under their absolute names.
if go16 { // hack: Go 1.6+ only
if !forward["net/http"]["vendor/golang.org/x/net/http2/hpack"] {
t.Errorf("forward[net/http] does not include vendor/golang.org/x/net/http2/hpack: %v",
strings.Replace(fmt.Sprint(forward["net/http"]), ":true", "", -1))
}
}
// Test Search is reflexive.
if !forward.Search(this)[this] {
t.Errorf("irreflexive: forward.Search(importgraph)[importgraph] not found")