You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
skills: no rule holds an absence assertion to the encoding it searches #1306
An assertion that a spelling is absent from encoded output cannot fail when the spelling differs from what the encoder writes. morphic-verifying-changes says what a test must reach (references/assertions-and-reach.md, references/tests-that-bite.md), and no rule names this shape:
A test written for #1302 asserted that no Constraints held a bound:
assert.NotContains(t, marshalForTest(t, doc), `"minItems": 1`, "no Constraints anywhere holds the bound")
marshalForTest encodes compact JSON, so "minItems":1 is what a document holds and the spaced spelling matched nothing, on any document. It was found by a planted defect that wrote the bound onto a Scalar the census also keeps verbatim:
SURVIVED census alias also reads collection bounds | 0
With the assertion reading the node's field instead, the same plant is killed:
KILLED census alias also reads collection bounds | TestCollectionBound_ANodeOfAnotherShapeKeepsItVerbatim
The rule's absence is what let the assertion read as a check. It was the only instance: once it was fixed, this finds none on the branch's tree.
A proposal: a rule in references/assertions-and-reach.md. Assert absence on the field that would hold the value, not on an encoding of the document. Where the encoding is the subject, assert the same spelling's presence in a control, so the search is shown to match. The probe is to plant the value and watch the assertion redden.
Out of scope
Presence assertions, which fail on a mismatched spelling and so announce themselves.
Activity