reporter

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2026 License: LGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderHTML

func RenderHTML(report *Report) (string, error)

RenderHTML generates the HTML report from a Report

Types

type FieldDiff

type FieldDiff struct {
	Name     string `json:"name"`
	Expected string `json:"expected"`
	Actual   string `json:"actual"`
	Matches  bool   `json:"matches"`
}

FieldDiff represents the comparison of a single field

type HeaderKV

type HeaderKV struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

HeaderKV represents a name/value header pair (used for client hints rendering). Stored as a slice (not a map) to keep output deterministic.

type ParserResult

type ParserResult struct {
	Name     string        `json:"name"`
	Passed   int           `json:"passed"`
	Failed   int           `json:"failed"`
	Failures []TestFailure `json:"failures,omitempty"`
}

ParserResult aggregates results for one parser type

func CollectBotResults

func CollectBotResults() (ParserResult, error)

func CollectBrowserResults

func CollectBrowserResults() (ParserResult, error)

func CollectCameraResults

func CollectCameraResults() (ParserResult, error)

func CollectCarBrowserResults

func CollectCarBrowserResults() (ParserResult, error)

func CollectConsoleResults

func CollectConsoleResults() (ParserResult, error)

func CollectFeedReaderResults

func CollectFeedReaderResults() (ParserResult, error)

func CollectFullParseResults

func CollectFullParseResults() (ParserResult, error)

func CollectFullParseResultsSample

func CollectFullParseResultsSample(n int, detectorOpts ...detector.Option) (ParserResult, error)

CollectFullParseResultsSample runs a deterministic sample of N fixtures from the full parse test. Uses a fixed seed so the same N always selects the same fixtures across runs.

func CollectLibraryResults

func CollectLibraryResults() (ParserResult, error)

func CollectMediaPlayerResults

func CollectMediaPlayerResults() (ParserResult, error)

func CollectMobileAppResults

func CollectMobileAppResults() (ParserResult, error)

func CollectNotebookResults

func CollectNotebookResults() (ParserResult, error)

func CollectOSResults

func CollectOSResults() (ParserResult, error)

func CollectPIMResults

func CollectPIMResults() (ParserResult, error)

func CollectParseClientResults

func CollectParseClientResults() (ParserResult, error)

func CollectParseDeviceResults

func CollectParseDeviceResults() (ParserResult, error)

func CollectTypeMethodsResults

func CollectTypeMethodsResults() (ParserResult, error)

func CollectVendorFragmentResults

func CollectVendorFragmentResults() (ParserResult, error)

func (*ParserResult) Percent

func (p *ParserResult) Percent() float64

Percent returns the pass percentage for this parser

type Report

type Report struct {
	GeneratedAt time.Time      `json:"generated_at"`
	TotalTests  int            `json:"total_tests"`
	PassedTests int            `json:"passed_tests"`
	FailedTests int            `json:"failed_tests"`
	Parsers     []ParserResult `json:"parsers"`
}

Report is the complete compatibility report

func CollectAll

func CollectAll(includeFull bool) (*Report, error)

CollectAll runs all collectors and returns combined results. If includeFull is true, includes the comprehensive full parse test (36K+ tests, slow).

func ReadJSON

func ReadJSON(r io.Reader) (*Report, error)

ReadJSON reads a report from JSON

func (*Report) Calculate

func (r *Report) Calculate()

Calculate populates totals from parser results

func (*Report) Compatibility

func (r *Report) Compatibility() float64

Compatibility returns the overall pass percentage

func (*Report) WriteJSON

func (r *Report) WriteJSON(w io.Writer) error

WriteJSON writes the report as JSON to the given writer

type TestFailure

type TestFailure struct {
	CaseIndex int    `json:"case_index"`
	UserAgent string `json:"user_agent"`
	// ClientHints contains the request headers used as client hints (if present in fixture).
	ClientHints []HeaderKV  `json:"client_hints,omitempty"`
	Fields      []FieldDiff `json:"fields"`
}

TestFailure represents a single failed test case

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL