mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
feat(verifier): fail the spec on a selector key that cannot match
An empty match is indistinguishable from a screen with no such element, so a mistyped key generates no action for the whole run and the campaign finishes clean having explored nothing. The goja boundary now throws, naming the key and the accepted list.
This commit is contained in:
1 parent
35b0856e6c
commit
1332471b72
3 files changed
+120
No files matched your search
@@ -792,3 +792,13 @@ func parseBounds(text string) (Bounds, error) {
|
||||
}
|
||||
return Bounds{}, fmt.Errorf("bounds %q: not in [L,T,R,B] or [x1,y1][x2,y2] form", text)
|
||||
}
|
||||
|
||||
// Tree returns the tree this node belongs to, or nil for a node built outside
|
||||
// Parse. Selector validation needs the whole tree: a key absent from one
|
||||
// subtree but present elsewhere is a key that can match.
|
||||
func (n *Node) Tree() *Tree {
|
||||
if n == nil {
|
||||
return nil
|
||||
}
|
||||
return n.tree
|
||||
}
|
||||
Reference in new issue
Block a user