From 971203cad3c4a5cdfd196a7ad5ce76b550d2ff9f Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Tue, 1 Sep 2020 15:41:36 -0400 Subject: [PATCH] cmd/go: remove TestScript/get_unicode and an internal get test case That test tested that import paths with non-ASCII unicode paths were allowed by the Go command. Remove this test case because golang.org/cl/251878 removes that support. Also rewrite a test case in TestRepoRootForImportPath in the test for cmd/go/internal/get to reflect that unicode directory names are now disallowed. Updates #29101 Change-Id: I669e220facd04fc82ccd05dd08e8f1ff4d48b1fd Reviewed-on: https://go-review.googlesource.com/c/go/+/252297 Run-TryBot: Michael Matloob TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/get/vcs_test.go | 7 ++-- src/cmd/go/testdata/script/get_unicode.txt | 40 ---------------------- 2 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 src/cmd/go/testdata/script/get_unicode.txt diff --git a/src/cmd/go/internal/get/vcs_test.go b/src/cmd/go/internal/get/vcs_test.go index 91800baa83d216..195bc231eb1789 100644 --- a/src/cmd/go/internal/get/vcs_test.go +++ b/src/cmd/go/internal/get/vcs_test.go @@ -32,13 +32,10 @@ func TestRepoRootForImportPath(t *testing.T) { Repo: "https://github.com/golang/groupcache", }, }, - // Unicode letters in directories (issue 18660). + // Unicode letters in directories are not valid. { "github.com/user/unicode/испытание", - &RepoRoot{ - vcs: vcsGit, - Repo: "https://github.com/user/unicode", - }, + nil, }, // IBM DevOps Services tests { diff --git a/src/cmd/go/testdata/script/get_unicode.txt b/src/cmd/go/testdata/script/get_unicode.txt deleted file mode 100644 index d3b82bdf250dd0..00000000000000 --- a/src/cmd/go/testdata/script/get_unicode.txt +++ /dev/null @@ -1,40 +0,0 @@ -env GO111MODULE=off - -[!exec:git] skip -[short] skip - -# Construct a repository that imports a non-ASCII path. -cd $WORK/_origin/example.com/unicode -exec git init -exec git config user.name 'Nameless Gopher' -exec git config user.email 'nobody@golang.org' -exec git add unicode.go -exec git commit -m 'add unicode.go' - -# Clone the repo into GOPATH so that 'go get -u' can find it. -mkdir $GOPATH/src/example.com/unicode -cd $GOPATH/src/example.com/unicode -exec git clone $WORK/_origin/example.com/unicode . - -# Construct the imported repository. -cd $WORK/_origin/example.com/испытание -exec git init -exec git config user.name 'Nameless Gopher' -exec git config user.email 'nobody@golang.org' -exec git add испытание.go -exec git commit -m 'add испытание.go' - -# Clone that repo into GOPATH too. -mkdir $GOPATH/src/example.com/испытание -cd $GOPATH/src/example.com/испытание -exec git clone $WORK/_origin/example.com/испытание . - -# Upgrading the importer should pull from the non-ASCII repo. -cd $GOPATH -go get -u example.com/unicode - --- $WORK/_origin/example.com/unicode/unicode.go -- -package unicode -import _ "example.com/испытание" --- $WORK/_origin/example.com/испытание/испытание.go -- -package испытание