]> Cypherpunks repositories - gostls13.git/commitdiff
embed/internal/embedtest: add test for embedded path starting with dash
authorIan Lance Taylor <iant@golang.org>
Mon, 19 Apr 2021 19:20:18 +0000 (12:20 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 4 May 2021 23:35:34 +0000 (23:35 +0000)
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>
src/embed/internal/embedtest/embed_test.go
src/embed/internal/embedtest/testdata/-not-hidden/fortune.txt [new file with mode: 0644]

index 43ae5c7e0569c87e3f9b08db68e24501a2c72ca1..2d50f5e01f1fafe1975dad2fc43c0fa83720e696 100644 (file)
@@ -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 (file)
index 0000000..31f2013
--- /dev/null
@@ -0,0 +1,2 @@
+WARNING: terminal is not fully functional
+ -  (press RETURN)