@@ -1639,51 +1639,6 @@ func TestSymlinkWarning(t *testing.T) {
1639
1639
tg .grepStderr ("ignoring symlink" , "list should have reported symlink" )
1640
1640
}
1641
1641
1642
- func TestShadowingLogic (t * testing.T ) {
1643
- skipIfGccgo (t , "gccgo has no standard packages" )
1644
- tg := testgo (t )
1645
- defer tg .cleanup ()
1646
- pwd := tg .pwd ()
1647
- sep := string (filepath .ListSeparator )
1648
- tg .setenv ("GOPATH" , filepath .Join (pwd , "testdata" , "shadow" , "root1" )+ sep + filepath .Join (pwd , "testdata" , "shadow" , "root2" ))
1649
-
1650
- // The math in root1 is not "math" because the standard math is.
1651
- tg .run ("list" , "-f" , "({{.ImportPath}}) ({{.ConflictDir}})" , "./testdata/shadow/root1/src/math" )
1652
- pwdForwardSlash := strings .ReplaceAll (pwd , string (os .PathSeparator ), "/" )
1653
- if ! strings .HasPrefix (pwdForwardSlash , "/" ) {
1654
- pwdForwardSlash = "/" + pwdForwardSlash
1655
- }
1656
- // The output will have makeImportValid applies, but we only
1657
- // bother to deal with characters we might reasonably see.
1658
- for _ , r := range " :" {
1659
- pwdForwardSlash = strings .ReplaceAll (pwdForwardSlash , string (r ), "_" )
1660
- }
1661
- want := "(_" + pwdForwardSlash + "/testdata/shadow/root1/src/math) (" + filepath .Join (runtime .GOROOT (), "src" , "math" ) + ")"
1662
- if strings .TrimSpace (tg .getStdout ()) != want {
1663
- t .Error ("shadowed math is not shadowed; looking for" , want )
1664
- }
1665
-
1666
- // The foo in root1 is "foo".
1667
- tg .run ("list" , "-f" , "({{.ImportPath}}) ({{.ConflictDir}})" , "./testdata/shadow/root1/src/foo" )
1668
- if strings .TrimSpace (tg .getStdout ()) != "(foo) ()" {
1669
- t .Error ("unshadowed foo is shadowed" )
1670
- }
1671
-
1672
- // The foo in root2 is not "foo" because the foo in root1 got there first.
1673
- tg .run ("list" , "-f" , "({{.ImportPath}}) ({{.ConflictDir}})" , "./testdata/shadow/root2/src/foo" )
1674
- want = "(_" + pwdForwardSlash + "/testdata/shadow/root2/src/foo) (" + filepath .Join (pwd , "testdata" , "shadow" , "root1" , "src" , "foo" ) + ")"
1675
- if strings .TrimSpace (tg .getStdout ()) != want {
1676
- t .Error ("shadowed foo is not shadowed; looking for" , want )
1677
- }
1678
-
1679
- // The error for go install should mention the conflicting directory.
1680
- tg .runFail ("install" , "./testdata/shadow/root2/src/foo" )
1681
- want = "go install: no install location for " + filepath .Join (pwd , "testdata" , "shadow" , "root2" , "src" , "foo" ) + ": hidden by " + filepath .Join (pwd , "testdata" , "shadow" , "root1" , "src" , "foo" )
1682
- if strings .TrimSpace (tg .getStderr ()) != want {
1683
- t .Error ("wrong shadowed install error; looking for" , want )
1684
- }
1685
- }
1686
-
1687
1642
func TestCgoDependsOnSyscall (t * testing.T ) {
1688
1643
if testing .Short () {
1689
1644
t .Skip ("skipping test that removes $GOROOT/pkg/*_race in short mode" )
0 commit comments