Skip to content

Commit

Permalink
go/packages/packagestest: make Export skip tests involving unsupporte…
Browse files Browse the repository at this point in the history
…d links

Also make Export create all parent directories before all files.
If the files are symlinks to directories, the target directory must
exist before the symlink is created on Windows. Otherwise, the symlink
will be created with the wrong type (and thus broken).

Fixes golang/go#46503
Updates golang/go#38772
Updates golang/go#39183

Change-Id: I17864ed66e0464e0ed1f56c55751b384b8c59484
Reviewed-on: https://go-review.googlesource.com/c/tools/+/234112
Trust: Bryan C. Mills <bcmills@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
  • Loading branch information
Bryan C. Mills authored and rinchsan committed Oct 9, 2021
1 parent c17b34b commit 12b7914
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/imports/fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"io/ioutil"
"log"
"path/filepath"
"runtime"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -1291,11 +1290,6 @@ func bar() {
// Test support for packages in GOPATH that are actually symlinks.
// Also test that a symlink loop does not block the process.
func TestImportSymlinks(t *testing.T) {
switch runtime.GOOS {
case "windows", "plan9":
t.Skipf("skipping test on %q as there are no symlinks", runtime.GOOS)
}

const input = `package p
var (
Expand Down Expand Up @@ -1331,11 +1325,6 @@ var (
}

func TestImportSymlinksWithIgnore(t *testing.T) {
switch runtime.GOOS {
case "windows", "plan9":
t.Skipf("skipping test on %q as there are no symlinks", runtime.GOOS)
}

const input = `package p
var (
Expand Down

0 comments on commit 12b7914

Please sign in to comment.