niceeval/expect provides only pure Match factories. A Match compares one candidate value; it does not record a result or decide a Verdict or score. t.check(value, match) reads value and registers an Assertion immediately. The returned handle only configures that same entry.
How to use it
Matchers
The signature and description for every matcher below are generated from theniceeval/expect source and stay in sync with the current implementation.
and
or
not
includes
excludes
pattern
similarity
includesUrl
min distinct http(s) URLs.
hasSections
min Markdown headings.
isDefined
isTrue
value === true.
isFalse
value === false.
commandSucceeded
CommandResult-like candidates whose exitCode === 0. It does not read stdout or stderr.
equals
matches
satisfies
defineValueMatch
defineScoreMatch
eventMatch
Match tool calls
ToolMatch compares one logical tool occurrence. It owns occurrence quantifiers such as .exactly(n) and .atLeast(n). Pass a name, an unquantified ToolMatch, or a positive quantified Match to calledTool. notCalledTool uses an unquantified selector to express zero matches.
jsonMatch for ordinary JSON, referencesAnyPath for paths, and commandMatch for command tokens. When output is absent, material is incomplete, or HITL has not finished, a Match becomes unavailable; it does not pretend to be an ordinary mismatch.
For complete signatures, material states, and three-valued counting rules, see Scoped assertions.
Common usage examples
Composition and three states
and / or must belong to the same domain. The internal result of a Boolean Match is matched, mismatched, or unavailable. or returns unavailable only when no child matches and at least one child’s evidence is incomplete; it does not treat an unknown result as a negative one. A Match itself has no Verdict, score, or control flow. ScoreMatch.atLeast(n) forms a threshold before registration. .score(n), parameterless .gate(), and .orStop() belong to the registered AssertionHandle.
The following lists stable fields on Match values themselves. Brands and evaluators are module-private implementation details, not author API.
Match
domain
name
BooleanMatch
kind
[matchRefinementBrand]
ScoreMatch
kind
atLeast
Custom matchers
defineValueMatch for a custom Boolean Match and defineScoreMatch for a continuous score. Both compare only one candidate. Reading files, scanning events, deciding coverage, and changing a Verdict remain the responsibility of Assertion registration entry points and the Runner.