CorpusCase class
One labelled case in the validation corpus: an input plus its ground truth.
The input is produced lazily by build — a pure-Dart SemanticsSnapshot for a synthetic fixture, or one built from a pumped widget for a real-world case. The ground truth is expected, the set of findings a human confirmed the input should produce.
For every category except CorpusCategory.realWorld the case isolates a
single ruleUnderTest: the harness scores only findings from that rule, so
unrelated rules cannot pollute the measurement. A realWorld case leaves
ruleUnderTest null, enables all rules, and must be labelled across every
one of them.
- Annotations
-
- @experimental
- @immutable
Constructors
-
CorpusCase({required String id, required CorpusCategory category, required Standard standard, required FutureOr<
SemanticsSnapshot> build(), List<ExpectedFinding> expected = const [], String? ruleUnderTest}) -
Creates a CorpusCase.
const
Properties
-
build
→ FutureOr<
SemanticsSnapshot> Function() -
Builds the input to audit. Called once per harness run.
final
- category → CorpusCategory
-
What role this case plays in the metrics (see CorpusCategory).
final
-
expected
→ List<
ExpectedFinding> -
The findings a human confirmed this case should produce. Empty for clean
and adversarial cases, which must stay silent.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
A stable, unique id for this case, e.g.
interactive_name/unnamed_button.final - isIsolated → bool
-
Whether this case isolates one ruleUnderTest (everything but realWorld).
no setter
- ruleUnderTest → String?
-
The single rule this case isolates, or null for a CorpusCategory.realWorld
case that runs every rule.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- standard → Standard
-
The standard pack to audit this case under. WCAG 2.2-only criteria only
fire under Standard.wcag22, so a case for such a rule must select it.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited