Documentation
¶
Overview ¶
Package crosscheck verifies that the TeX and Typst frontends lower the pinned paired corpus to equivalent semantic IR and render equal output.
Crosscheck is test infrastructure. It is not imported by the renderer and uses pinned, tracked fixtures only.
Index ¶
- func CompareOutputToFixture(got *display.Box, want fixture.Frame) string
- func CompareOutputs(got, want *display.Box) string
- func CompareReports(want, got Report) error
- func LoadPairedCorpus(fixtureRoot string) (*fixture.Corpus, error)
- type CaseResult
- type Kind
- type KnownDifference
- type Options
- type Report
- func LoadReport(path string) (Report, error)
- func Refresh(ctx context.Context, opts Options, reasons map[string]string) (Report, error)
- func ReviewedRefresh(results []CaseResult, previous Report, reasons map[string]string) (Report, error)
- func Verify(ctx context.Context, opts Options) (Report, error)
- type SemanticDifference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareOutputToFixture ¶
CompareOutputToFixture compares renderer output to a Typlet frame. Both values are first expressed in the fixture frame's anchor coordinate system.
func CompareOutputs ¶
CompareOutputs compares two renderer outputs in baseline coordinates.
func CompareReports ¶
CompareReports checks exact case order, kinds, and reviewed reasons.
Types ¶
type CaseResult ¶
type CaseResult struct {
ID string `json:"id"`
Index int `json:"index"`
Category string `json:"category"`
Kind Kind `json:"kind"`
Detail string `json:"detail,omitempty"`
KnownReason string `json:"reason,omitempty"`
}
CaseResult records the complete disposition of one corpus case.
type KnownDifference ¶
type Report ¶
type Report struct {
SchemaVersion int `json:"schemaVersion"`
Corpus string `json:"corpus"`
ToleranceDIP float64 `json:"toleranceDIP"`
Total int `json:"total"`
Pass int `json:"pass"`
SemanticIR int `json:"semanticIRMismatch"`
Layout int `json:"layoutMismatch"`
Fixture int `json:"fixtureMismatch"`
PairDifference int `json:"documentedPairDifference"`
Unexplained int `json:"unexplained"`
Cases []CaseResult `json:"cases"`
}
Report is a deterministic, complete account of a paired corpus.
func LoadReport ¶
LoadReport decodes and validates a committed baseline.
func Refresh ¶
Refresh recomputes observed dispositions while requiring explicit reasons for every new non-passing kind and for every kind transition.
func ReviewedRefresh ¶
func ReviewedRefresh(results []CaseResult, previous Report, reasons map[string]string) (Report, error)
ReviewedRefresh applies the explicit baseline review policy to observed cases. Details may change under an unchanged kind; a kind transition or new non-passing case requires a reviewer-supplied reason.
func (Report) MarshalCanonical ¶
MarshalCanonical returns stable, indented JSON with a trailing newline.
type SemanticDifference ¶
func CompareSemantic ¶
func CompareSemantic(want, got any) *SemanticDifference
func (*SemanticDifference) String ¶
func (d *SemanticDifference) String() string