@@ -282,52 +282,6 @@ func TestLoadImportsTestVariants(t *testing.T) {
282
282
}
283
283
}
284
284
285
- func TestLoadImportsC (t * testing.T ) {
286
- // This test checks that when a package depends on the
287
- // test variant of "syscall", "unsafe", or "runtime/cgo", that dependency
288
- // is not removed when those packages are added when it imports "C".
289
- //
290
- // For this test to work, the external test of syscall must have a dependency
291
- // on net, and net must import "syscall" and "C".
292
- if runtime .GOOS == "windows" {
293
- t .Skipf ("skipping on windows; packages on windows do not satisfy conditions for test." )
294
- }
295
- if runtime .GOOS == "plan9" {
296
- // See https://github.com/golang/go/issues/27100.
297
- t .Skip (`skipping on plan9; for some reason "net [syscall.test]" is not loaded` )
298
- }
299
-
300
- cfg := & packages.Config {
301
- Mode : packages .LoadImports ,
302
- Tests : true ,
303
- }
304
- initial , err := packages .Load (cfg , "syscall" , "net" )
305
- if err != nil {
306
- t .Fatalf ("failed to load imports: %v" , err )
307
- }
308
-
309
- _ , all := importGraph (initial )
310
-
311
- for _ , test := range []struct {
312
- pattern string
313
- wantImport string // an import to check for
314
- }{
315
- {"net" , "syscall:syscall" },
316
- {"net [syscall.test]" , "syscall:syscall [syscall.test]" },
317
- {"syscall_test [syscall.test]" , "net:net [syscall.test]" },
318
- } {
319
- // Test the import paths.
320
- pkg := all [test .pattern ]
321
- if pkg == nil {
322
- t .Errorf ("package %q not loaded" , test .pattern )
323
- continue
324
- }
325
- if imports := strings .Join (imports (pkg ), " " ); ! strings .Contains (imports , test .wantImport ) {
326
- t .Errorf ("package %q: got \n %s, \n want to have %s" , test .pattern , imports , test .wantImport )
327
- }
328
- }
329
- }
330
-
331
285
func TestLoadAbsolutePath (t * testing.T ) {
332
286
tmp , cleanup := makeTree (t , map [string ]string {
333
287
"gopatha/src/a/a.go" : `package a` ,
0 commit comments