Want a selector on a repeating template refused as a selector, and the probe held to a descent ending on a linked table
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ func TestPathCheckStopsAtAMissingSegment(t *testing.T) {
|
|||||||
t.Fatalf("pathLeaves(a.b) = %v, want the one leaf", leaves)
|
t.Fatalf("pathLeaves(a.b) = %v, want the one leaf", leaves)
|
||||||
}
|
}
|
||||||
w := &pathCheck{tail: []string{"a", "nope", "deeper"}}
|
w := &pathCheck{tail: []string{"a", "nope", "deeper"}}
|
||||||
_, err := w.walk(n, w.tail)
|
_, err := w.run(n)
|
||||||
if err == nil || !strings.Contains(err.Error(), `no field "nope"`) {
|
if err == nil || !strings.Contains(err.Error(), `no field "nope"`) {
|
||||||
t.Errorf("walk(a.nope.deeper) = %v, want the missing segment named", err)
|
t.Errorf("walk(a.nope.deeper) = %v, want the missing segment named", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -356,8 +356,9 @@ func TestTableSelectorInAReference(t *testing.T) {
|
|||||||
"ambiguous name": {`"{/locality[Sandby].name}"`, "L7, L8"},
|
"ambiguous name": {`"{/locality[Sandby].name}"`, "L7, L8"},
|
||||||
"not inside": {`"{/region[12].municipality[0180].name}"`, "not inside"},
|
"not inside": {`"{/region[12].municipality[0180].name}"`, "not inside"},
|
||||||
"selector on template": {`"{/x[1].a}"`, "not a table"},
|
"selector on template": {`"{/x[1].a}"`, "not a table"},
|
||||||
|
"selector on repeating template": {`"{/rep[1]}"`, "not a table"},
|
||||||
} {
|
} {
|
||||||
_, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, with(files, map[string]string{"bad.json": c.json}))))
|
_, err := New(WithoutShippedData(), WithDataPath(writeFiles(t, with(files, map[string]string{"bad.json": c.json, "rep.json": `{"format":"x","repeat":2}`}))))
|
||||||
if err == nil || !strings.Contains(err.Error(), c.want) {
|
if err == nil || !strings.Contains(err.Error(), c.want) {
|
||||||
t.Errorf("%s: New = %v, want an error mentioning %q", name, err, c.want)
|
t.Errorf("%s: New = %v, want an error mentioning %q", name, err, c.want)
|
||||||
}
|
}
|
||||||
@@ -1050,8 +1051,10 @@ func TestProbeReportsTheTablesADrawPins(t *testing.T) {
|
|||||||
"municipality[1281].locality.name",
|
"municipality[1281].locality.name",
|
||||||
"municipality.locality[L4].name",
|
"municipality.locality[L4].name",
|
||||||
"region",
|
"region",
|
||||||
|
"region.municipality",
|
||||||
"region.municipality.name",
|
"region.municipality.name",
|
||||||
"region.locality.name",
|
"region.locality.name",
|
||||||
|
"region[12].locality",
|
||||||
"region[12].locality.code",
|
"region[12].locality.code",
|
||||||
"region[12].municipality.locality.code",
|
"region[12].municipality.locality.code",
|
||||||
"region[12].name",
|
"region[12].name",
|
||||||
|
|||||||
Reference in New Issue
Block a user