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:
2026-10-11 12:15:41 +02:00
committed by Lillem4n
parent 165b67e843
commit 29a76d5d9a
11 changed files with 165 additions and 58 deletions
-22
View File
@@ -1,22 +0,0 @@
package SE_test
import (
"io/fs"
"testing"
"github.com/larvit/fejkdata"
"github.com/larvit/fejkdata/data/geo/SE"
)
func TestFSLoadsByItsManifest(t *testing.T) {
if _, err := fs.Stat(SE.FS, ".fejkdata.json"); err != nil {
t.Fatalf("FS holds no manifest: %v", err)
}
f, err := fejkdata.New(fejkdata.WithDataFS(SE.FS))
if err != nil {
t.Fatalf("New(WithDataFS(FS)) = %v", err)
}
if len(f.List()) == 0 {
t.Error("List() is empty, want the module's categories")
}
}