Test that the shipped data loads from a Go package per module, that a bare New fails naming WithDataFS, and that a read nothing provides names the modules its reader's manifest reads

This commit is contained in:
2026-10-10 13:08:01 +02:00
committed by Lillem4n
parent bf1becbb59
commit 3368f085fd
26 changed files with 471 additions and 188 deletions
+2 -2
View File
@@ -253,7 +253,7 @@ func TestNameErrors(t *testing.T) {
}
files[name] = body
}
_, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, files)))
_, err := New(WithDataPath(writeFiles(t, files)))
if c.want == "" {
if err != nil {
t.Fatalf("New() = %v, want it to load", err)
@@ -463,7 +463,7 @@ func TestARowThroughANameHintsAPathThatLoads(t *testing.T) {
files := nameTables()
files["card.json"] = `{"format":"{x as r}{r[01]}","x":"{/region}"}`
want := `a path through name "r" may not select a row; bind the row to a name of its own`
if _, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, files))); err == nil || !strings.Contains(err.Error(), want) {
if _, err := New(WithDataPath(writeFiles(t, files))); err == nil || !strings.Contains(err.Error(), want) {
t.Errorf("New(a field-bound name selecting a row) = %v, want %s", err, want)
}
}