Skip to content

Commit ca2b41b

Browse files
adonovangopherbot
authored andcommitted
x/tools: use internal/expect instead of go/expect
The only remaining uses of go/expect are from packagestest. Updates golang/go#70229 Change-Id: I5a8c835b761381747fbd3f936d261ed773b536e3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/625919 Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent b22f1ad commit ca2b41b

File tree

8 files changed

+9
-12
lines changed

8 files changed

+9
-12
lines changed

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ Selected packages:
5151

5252
- `go/cfg` provides a simple control-flow graph (CFG) for a Go function.
5353

54-
- `go/expect` reads Go source files used as test inputs and interprets
55-
special comments within them as queries or assertions for testing.
56-
5754
- `go/gcexportdata` and `go/gccgoexportdata` read and write the binary
5855
files containing type information used by the standard and `gccgo` compilers.
5956

go/ssa/builder_generic_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"sort"
1414
"testing"
1515

16-
"golang.org/x/tools/go/expect"
1716
"golang.org/x/tools/go/loader"
1817
"golang.org/x/tools/go/ssa"
18+
"golang.org/x/tools/internal/expect"
1919
)
2020

2121
// TestGenericBodies tests that bodies of generic functions and methods containing
@@ -29,7 +29,7 @@ import (
2929
//
3030
// where a, b and c are the types of the arguments to the print call
3131
// serialized using go/types.Type.String().
32-
// See x/tools/go/expect for details on the syntax.
32+
// See x/tools/internal/expect for details on the syntax.
3333
func TestGenericBodies(t *testing.T) {
3434
for _, content := range []string{
3535
`

go/ssa/builder_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ import (
2525

2626
"golang.org/x/sync/errgroup"
2727
"golang.org/x/tools/go/analysis/analysistest"
28-
"golang.org/x/tools/go/expect"
2928
"golang.org/x/tools/go/packages"
3029
"golang.org/x/tools/go/ssa"
3130
"golang.org/x/tools/go/ssa/ssautil"
31+
"golang.org/x/tools/internal/expect"
3232
"golang.org/x/tools/internal/testenv"
3333
)
3434

go/ssa/source_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818
"testing"
1919

2020
"golang.org/x/tools/go/ast/astutil"
21-
"golang.org/x/tools/go/expect"
2221
"golang.org/x/tools/go/ssa"
22+
"golang.org/x/tools/internal/expect"
2323
)
2424

2525
func TestObjValueLookup(t *testing.T) {

gopls/internal/cache/mod_tidy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func missingModuleDiagnostics(ctx context.Context, snapshot *Snapshot, pm *Parse
267267
// Example:
268268
//
269269
// import (
270-
// "golang.org/x/tools/go/expect"
270+
// "golang.org/x/tools/internal/expect"
271271
// "golang.org/x/tools/go/packages"
272272
// )
273273
// They both are related to the same module: "golang.org/x/tools".

gopls/internal/test/marker/doc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Use this command to run the tests:
1010
1111
$ go test ./gopls/internal/test/marker [-update]
1212
13-
A marker test uses the '//@' marker syntax of the x/tools/go/expect package
13+
A marker test uses the '//@' marker syntax of the x/tools/internal/expect package
1414
to annotate source code with various information such as locations and
1515
arguments of LSP operations to be executed by the test. The syntax following
1616
'@' is parsed as a comma-separated list of ordinary Go function calls, for
@@ -277,7 +277,7 @@ The following markers are supported within marker tests:
277277
278278
# Argument conversion
279279
280-
Marker arguments are first parsed by the go/expect package, which accepts
280+
Marker arguments are first parsed by the internal/expect package, which accepts
281281
the following tokens as defined by the Go spec:
282282
- string, int64, float64, and rune literals
283283
- true and false

gopls/internal/test/marker/marker_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030

3131
"github.com/google/go-cmp/cmp"
3232
"github.com/google/go-cmp/cmp/cmpopts"
33-
"golang.org/x/tools/go/expect"
3433
"golang.org/x/tools/gopls/internal/cache"
3534
"golang.org/x/tools/gopls/internal/debug"
3635
"golang.org/x/tools/gopls/internal/lsprpc"
@@ -42,6 +41,7 @@ import (
4241
"golang.org/x/tools/gopls/internal/util/safetoken"
4342
"golang.org/x/tools/internal/diff"
4443
"golang.org/x/tools/internal/diff/myers"
44+
"golang.org/x/tools/internal/expect"
4545
"golang.org/x/tools/internal/jsonrpc2"
4646
"golang.org/x/tools/internal/jsonrpc2/servertest"
4747
"golang.org/x/tools/internal/testenv"

internal/refactor/inline/inline_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"unsafe"
2424

2525
"golang.org/x/tools/go/ast/astutil"
26-
"golang.org/x/tools/go/expect"
2726
"golang.org/x/tools/go/packages"
2827
"golang.org/x/tools/go/types/typeutil"
2928
"golang.org/x/tools/internal/diff"
29+
"golang.org/x/tools/internal/expect"
3030
"golang.org/x/tools/internal/refactor/inline"
3131
"golang.org/x/tools/internal/testenv"
3232
"golang.org/x/tools/txtar"

0 commit comments

Comments
 (0)