1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00
go/imports
Heschi Kreinick d1d6d0cbb6 imports: refactor tests
We plan to change goimports to use go/packages, which requires changing
its internal design. Having tests use the external interface makes those
changes easier. After this change almost all testing is through Process.

Broadly speaking, the changes are:

- Switch to subtests wherever possible. This involved making up many
names, which I hope are accurate.

- Convert tests that used findImport directly to use Process instead.
This often made them slightly larger but not unduly IMO.

- Replace simple tests with entries in the giant table at the top.

- Remove uses of custom goroots, which are troublesome for
go/packages' use of the go command. Almost none of them were actually
necessary. I left one in TestGoRootPrefixOfGoPath; I'm not sure how
to handle it yet.

Change-Id: I7b810750f72842b58223f102097ccbb51b82bf39
Reviewed-on: https://go-review.googlesource.com/c/140840
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-12 19:02:34 +00:00
..
fix_test.go imports: refactor tests 2018-10-12 19:02:34 +00:00
fix.go internal/gopathwalk: create 2018-10-12 18:13:39 +00:00
imports.go imports: Process should accept nil src 2018-04-12 23:47:31 +00:00
mkindex.go go.tools/imports: move goimports from github to go.tools. 2013-12-17 21:21:03 -05:00
mkstdlib.go imports: update zstdlib to Go 1.11 2018-09-10 04:49:24 +00:00
sortimports.go imports: support repairing import grouping/ordering 2018-10-12 15:41:53 +00:00
zstdlib.go imports: update zstdlib to Go 1.11 2018-09-10 04:49:24 +00:00