aboutsummaryrefslogtreecommitdiff
path: root/src/embed
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-04-19 12:20:18 -0700
committerIan Lance Taylor <iant@golang.org>2021-05-04 23:35:34 +0000
commit137be7712f479dc820ef56c818913a98fa24b80e (patch)
tree8297714cc309e1e34c8c543eefe87d540ae064ac /src/embed
parentcb0658e624e33ca3e96036dbdd48b1282acb189d (diff)
downloadgo-137be7712f479dc820ef56c818913a98fa24b80e.tar.gz
go-137be7712f479dc820ef56c818913a98fa24b80e.zip
embed/internal/embedtest: add test for embedded path starting with dash
Fixes #45447 Change-Id: I1b1a0a844ee4345ced1a007bbe53db035183175f Reviewed-on: https://go-review.googlesource.com/c/go/+/311529 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/embed')
-rw-r--r--src/embed/internal/embedtest/embed_test.go4
-rw-r--r--src/embed/internal/embedtest/testdata/-not-hidden/fortune.txt2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/embed/internal/embedtest/embed_test.go b/src/embed/internal/embedtest/embed_test.go
index 43ae5c7e05..2d50f5e01f 100644
--- a/src/embed/internal/embedtest/embed_test.go
+++ b/src/embed/internal/embedtest/embed_test.go
@@ -102,12 +102,12 @@ func TestHidden(t *testing.T) {
t.Logf("//go:embed testdata")
testDir(t, dir, "testdata",
- "ascii.txt", "glass.txt", "hello.txt", "i/", "ken.txt")
+ "-not-hidden/", "ascii.txt", "glass.txt", "hello.txt", "i/", "ken.txt")
t.Logf("//go:embed testdata/*")
testDir(t, star, "testdata",
- ".hidden/", "_hidden/", "ascii.txt", "glass.txt", "hello.txt", "i/", "ken.txt")
+ "-not-hidden/", ".hidden/", "_hidden/", "ascii.txt", "glass.txt", "hello.txt", "i/", "ken.txt")
testDir(t, star, "testdata/.hidden",
"fortune.txt", "more/") // but not .more or _more
diff --git a/src/embed/internal/embedtest/testdata/-not-hidden/fortune.txt b/src/embed/internal/embedtest/testdata/-not-hidden/fortune.txt
new file mode 100644
index 0000000000..31f2013f94
--- /dev/null
+++ b/src/embed/internal/embedtest/testdata/-not-hidden/fortune.txt
@@ -0,0 +1,2 @@
+WARNING: terminal is not fully functional
+ - (press RETURN)