Commit b752317
committed
internal/analysisinternal: disable AddImport test without go command
The AddImport test uses the default importer, which calls go list.
This fails in environments that can't call the go command, like
js/wasm.
Add a predicate to testenv that asserts the need for the default
importer, and call it from TestAddImport.
A subtlety: although this bug manifested itself only for the dot-import
cases, in fact all the test cases failed type checking on js/wasm for
this reason. But a successful type-check is not a precondition for
the test (see the new comment in TestAddImport). What caused the
particular test case to fail was a bad diff resulting from how the edit
was applied in the presence of that failure.
Fixes golang/go#71645.
Change-Id: Ib04afad108c323999bb67f329cf8d9cf329fead1
Reviewed-on: https://go-review.googlesource.com/c/tools/+/648580
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>1 parent d98774e commit b752317
File tree
2 files changed
+16
-0
lines changed- internal
- analysisinternal
- testenv
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
273 | 279 | | |
274 | 280 | | |
275 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
281 | 291 | | |
282 | 292 | | |
283 | 293 | | |
| |||
0 commit comments