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:
+2
-2
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user