Commit Graph

8 Commits

Author SHA1 Message Date
83e6e27d12 style(format): adopt --importgrouping testable-bottom from canonical rules-swift
Group @testable imports at the bottom, per public/rules-swift's swiftformat. A
behavior-preserving import-ordering reformat across 252 files (mostly tests).
--trailingclosures was deliberately not adopted (cosmetic, and swiftformat flags
it as caution-worthy).
2026-06-18 20:33:07 +02:00
067aa91861 fix(html): fragment parser reconstructs active formatting elements
The fragment TreeBuilder gains the HTML5 active-formatting-list and reconstruct
step that the document builder already had: when a formatting element (b, i,
em, ...) is closed out of order, it is remembered and re-opened for the
following content. So HTML.parse now agrees with HTML.parseDocument and the
spec, e.g. <b><i></b>X</i> -> <b><i></i></b><i>X</i> and
<p>1<b>2<i>3</b>4</i>5</p> -> <p>1<b>2<i>3</i></b><i>4</i>5</p>. The conformance
corpus that surfaced this now checks the fragment path directly.

Closes #109
2026-06-10 01:59:16 +02:00
80af0067e9 test(conformance): add an HTML5 tree-construction corpus
Grow the Tier-2 conformance corpus with 8 HTML5 cases (void elements, implied
li/p closing, tag-case normalization, the adoption agency with and without
trailing text, entity decoding, stray-end-tag) checked through the
validation-driven harness against the HTML5 parsing algorithm.

The corpus surfaced its first real divergence: HTML.parse (fragment) does not
reconstruct active formatting elements the way HTML.parseDocument (document,
spec-correct) does, so <b><i></b>X</i> yields <b><i></i></b>X instead of
<b><i></i></b><i>X</i>. The corpus uses the document path (spec-correct) and
the divergence is filed as #109.
2026-06-10 01:46:25 +02:00
821cc2cf88 test(conformance): add an XSLT 1.0 transformation corpus
Grow the Tier-2 conformance corpus with 10 XSLT cases (value-of, for-each,
if, choose/otherwise, sort, variable, format-number, concat, apply-templates,
and a named template with a parameter) transformed through the public API and
checked through the validation-driven harness against the spec output.

Part of #105 (Tier 2)
2026-06-10 01:40:58 +02:00
62fea5c26c test(conformance): add a RELAX NG pattern corpus
Grow the Tier-2 conformance corpus with 12 RELAX NG pattern cases (text,
optional, oneOrMore, choice, ordered group, required attribute, interleave,
empty) validated through the public compact-syntax API and checked through
the validation-driven harness against the pattern semantics.

Part of #105 (Tier 2)
2026-06-09 19:30:23 +02:00
2ae08af282 test(conformance): add an XSD datatype/facet corpus
Grow the Tier-2 conformance corpus with 13 XSD datatype and facet cases
(integer lexical space, minInclusive/maxInclusive range, length, pattern,
enumeration, boolean) validated end-to-end through the public schema API and
checked through the validation-driven harness against the spec verdict.

Part of #105 (Tier 2)
2026-06-09 19:25:14 +02:00
cec913aa70 test(conformance): add an XPath 1.0 core-function corpus
Grow the Tier-2 conformance corpus with 16 XPath core-function cases (concat,
substring, string-length, normalize-space, translate, substring-before/after,
contains, starts-with, round/floor/ceiling, count, and the Infinity/NaN
division cases) checked through the same validation-driven harness against
their spec-mandated string results.

Part of #105 (Tier 2)
2026-06-09 19:18:59 +02:00
83507939de feat(validation): conformance-corpus harness via the validation framework
Begin Tier-2 conformance checking, expressed through the OpenAPIKit validation
idiom rather than an ad-hoc loop. ConformanceCase is a Validatable named
expectation; Conformance.matchesExpected is a Validation<ConformanceCase, Void>
that emits one located ValidationError per diverging case, so a suite reports
every failure at once with the case name as its coding path. Seeded with a
Canonical XML 1.0 corpus (attribute ordering, empty-element expansion, comment
removal, CDATA-to-escaped-text, PIs, namespace rendering) and a test proving a
divergence is reported as a located failure. Growing the corpora against the
official suites is the ongoing Tier-2 work.

Part of #105 (Tier 2)
2026-06-09 19:08:17 +02:00