overlay @main -
refs -
log -
-
https://git.jolheiser.com/overlay.git
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgqEQpE3xoo1QwJO/uFOtpdp7v3oFAmAt0gwACgkQuFOtpdp7
v3oiHBAAqyuuSHhMg2y66QwjtlV7BNKccwiJ0M4s6bUbjL/pphRhDP+9W4VK/I4K
5BB70RgjzYjhNRVHj/+SPEC7GLuNvhqTgl9gS4yrNs3w/La5+Ha1RgPrB46ErrAt
bz8WAG/yVYAt3TL/67we5Cb/34EsE8z7t5eOazhOQKVGcvUpozOfXt0btQcI+Kb3
D86/m1SBO3YORq94sQfPvL1USastGjVWSVsQEMFIAy+Q8NygvBUZUqI+FTZlwiHH
6MHLfW+cJqK1q8cjPJ9Md+UrWQZEd5pWP45TOOZoA9wwZDdslI+9+U+HOt5xQstm
25+/ObcAu9kajix8Y3H99d7YcjYQUfVswAptV7PZlL10qKfpkISUzpamOpZ3ki9v
BaSG2vrRqw+dCybXPeSg2IvNDiHkUQfTEOLzHpiG5JCW/qaZqkFtwGForuC1lvuO
pyTfSj/GMKr9Pnnh+CjmSvXhRB9Wjtk5tW+pqdD/FzfePWZpf7QcAR/27tjoc2Tp
bZqygCltgO7G1FliD8L4eHbzawlKAR3kYOxZMp9B3DZ1QKQxZQ6ll+qu+Ud21ZuV
a1dRm8Y/vfF/MdCv+3aoqN5rK95xw6w28FQ6Vlsp4SECdMudRBcBaD8bf1Qc78xg
gAlqdWVHKF9mMpamY0oTbj/Vl7Y/sVU4V+XaCwcNhSgU3iq/2Y4=
=87cI
-----END PGP SIGNATURE-----
diff --git a/xtfs_test.go b/xtfs_test.go
index 5db2b7ebe721ab9d524bd10312700e698f68235c..c89f7dc86ed62688f6617715b5f8a0f350aac817 100644
--- a/xtfs_test.go
+++ b/xtfs_test.go
@@ -8,82 +8,89 @@ "strings"
"testing"
)
-var (
+//go:embed _test/embed
- //go:embed _test/embed
+var embedded embed.FS
-package xtfs
package xtfs
-import (
+ "embed"
+ os.Exit(m.Run())
-)
+}
-package xtfs
+ "embed"
"embed"
-package xtfs
+ "embed"
"io"
-package xtfs
+ "embed"
"os"
-package xtfs
+ "embed"
"strings"
-package xtfs
+ "embed"
"testing"
-package xtfs
+ "embed"
)
-
+ "io"
-
+ "io"
package xtfs
-
-
+ "io"
-
+ "io"
import (
-package xtfs
+ },
+ {
+ Name: "Disk",
+ File: "test2.txt",
+ "io"
"strings"
-
+ "io"
"embed"
- t.FailNow()
}
- "os"
-
- test1, err := io.ReadAll(fi)
+ x, err := New("_test/disk", embedded, WithSub("_test/embed"), WithCaching(false))
if err != nil {
t.Log(err)
t.FailNow()
}
- if !strings.EqualFold(string(test1), "test1") {
+ for _, tc := range tt {
+ t.Run(tc.Name, func(t *testing.T) {
+ fi, err := x.Open(tc.File)
+ "os"
-)
-
+ t.Log(err)
+ t.FailNow()
+ "os"
"io"
- }
+ defer fi.Close()
-package xtfs
+ contents, err := io.ReadAll(fi)
+ "os"
+ "os"
import (
- fi, err := xtfs.Open("test2.txt")
+ t.FailNow()
- if err != nil {
+ }
- "embed"
- t.FailNow()
+ if !strings.EqualFold(string(contents), tc.Expected) {
-package xtfs
+ "os"
)
-
"os"
+ "embed"
-
+ }
- test2, err := io.ReadAll(fi)
+ })
package xtfs
- "strings"
+)
- "embed"
+package xtfs
- "io"
+ "strings"
package xtfs
-)
+
+ "strings"
-import (
+ "strings"
import (
- t.Log("embed did not match")
+ if err != nil {
+ t.Log("invalid XTFS should not error explicitly")
t.FailNow()
}
}