Test that a manifest's namespace mounts its source under a dot path, that each shipped module loads from data/<lowered namespace>, and that a load failure's note reaches Fake, FakeTemplate and FakeStruct once
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package SE_test
|
||||
package enus_test
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"testing"
|
||||
|
||||
"github.com/larvit/fejkdata"
|
||||
"github.com/larvit/fejkdata/data/geo/SE"
|
||||
"github.com/larvit/fejkdata/data/enus"
|
||||
)
|
||||
|
||||
func TestFSLoadsByItsManifest(t *testing.T) {
|
||||
if _, err := fs.Stat(SE.FS, ".fejkdata.json"); err != nil {
|
||||
if _, err := fs.Stat(enus.FS, ".fejkdata.json"); err != nil {
|
||||
t.Fatalf("FS holds no manifest: %v", err)
|
||||
}
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(SE.FS))
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(enus.FS))
|
||||
if err != nil {
|
||||
t.Fatalf("New(WithDataFS(FS)) = %v", err)
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package en_US_test
|
||||
package geose_test
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"testing"
|
||||
|
||||
"github.com/larvit/fejkdata"
|
||||
"github.com/larvit/fejkdata/data/en_US"
|
||||
"github.com/larvit/fejkdata/data/geose"
|
||||
)
|
||||
|
||||
func TestFSLoadsByItsManifest(t *testing.T) {
|
||||
if _, err := fs.Stat(en_US.FS, ".fejkdata.json"); err != nil {
|
||||
if _, err := fs.Stat(geose.FS, ".fejkdata.json"); err != nil {
|
||||
t.Fatalf("FS holds no manifest: %v", err)
|
||||
}
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(en_US.FS))
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(geose.FS))
|
||||
if err != nil {
|
||||
t.Fatalf("New(WithDataFS(FS)) = %v", err)
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package sv_SE_test
|
||||
package geous_test
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"testing"
|
||||
|
||||
"github.com/larvit/fejkdata"
|
||||
"github.com/larvit/fejkdata/data/sv_SE"
|
||||
"github.com/larvit/fejkdata/data/geous"
|
||||
)
|
||||
|
||||
func TestFSLoadsByItsManifest(t *testing.T) {
|
||||
if _, err := fs.Stat(sv_SE.FS, ".fejkdata.json"); err != nil {
|
||||
if _, err := fs.Stat(geous.FS, ".fejkdata.json"); err != nil {
|
||||
t.Fatalf("FS holds no manifest: %v", err)
|
||||
}
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(sv_SE.FS))
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(geous.FS))
|
||||
if err != nil {
|
||||
t.Fatalf("New(WithDataFS(FS)) = %v", err)
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package US_test
|
||||
package svse_test
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"testing"
|
||||
|
||||
"github.com/larvit/fejkdata"
|
||||
"github.com/larvit/fejkdata/data/geo/US"
|
||||
"github.com/larvit/fejkdata/data/svse"
|
||||
)
|
||||
|
||||
func TestFSLoadsByItsManifest(t *testing.T) {
|
||||
if _, err := fs.Stat(US.FS, ".fejkdata.json"); err != nil {
|
||||
if _, err := fs.Stat(svse.FS, ".fejkdata.json"); err != nil {
|
||||
t.Fatalf("FS holds no manifest: %v", err)
|
||||
}
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(US.FS))
|
||||
f, err := fejkdata.New(fejkdata.WithDataFS(svse.FS))
|
||||
if err != nil {
|
||||
t.Fatalf("New(WithDataFS(FS)) = %v", err)
|
||||
}
|
||||
Reference in New Issue
Block a user