PureXML/Tests
Mihaela Mihaljevic 7d22194614
perf(parse): build the TreeNode tree directly from the event stream (#295)
parseTree ran TreeNode(parse(...)), which allocates two full trees: the parser
builds an immutable value Node tree, then TreeNode.init(_:) walks it to build
the mutable reference tree. The parsed tree is the deliverable, so building the
value tree first is pure overhead.

Parser.buildTree is the direct counterpart to build: the same iterative event
loop with the same element stack and the same well-formedness guards (an
unmatched end tag throws unexpectedEndOfInput; a document with no element throws
emptyDocument), but it accumulates TreeNode children per frame and adopts them
when an element closes, so the tree is allocated once. The produced tree is
identical: same kinds, names, attributes, values, child order, and parent links.

Measured parse ~8% faster on the 20k-item generated corpus via a same-state A/B
(6.1x to ~5.5x slower than libxml2). Verified by ParseTreeDirectBuildTests (a
structural differential against the convert-from-Node path, plus throw-parity
and a serialized round-trip), the full suite and the W3C XML conformance,
RELAX NG, and Xalan corpora (which all build trees through parseTree), the WASM
build, and an adversarial equivalence review.
2026-06-25 14:15:57 +02:00
..
Fixtures fix(xslt): xsl:namespace-alias keeps the literal prefix, remapping only the URI (closes namespace19/23/24/35/113) (#273) 2026-06-24 15:43:02 +02:00
AdversarialCriticTests.swift
ByteFastPathTests.swift perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
C14NSpecExampleTests.swift
CanonicalC14N11Tests.swift
CanonicalPrefixRewriteTests.swift
CanonicalSelectionTests.swift
CanonicalSubsetTests.swift
CanonicalTests.swift
CatalogBaseURITests.swift
CatalogGroupPreferTests.swift
CatalogSGMLTests.swift
CatalogSuffixPreferTests.swift
CatalogTests.swift
ConformanceCanonicalModesTests.swift
ConformanceCatalogTests.swift
ConformanceCorpusTests.swift
ConformanceDTDTests.swift
ConformanceEmittingTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
ConformanceHTMLDepthTests.swift
ConformanceRegexTests.swift
ConformanceSchematronTests.swift
ConformanceXIncludeTests.swift
ConformanceXPathAxisTests.swift
ContentMatcherDifferentialTests.swift
ContentMatcherWorstCaseTests.swift
ContentModelDeterminismTests.swift fix(schema): reject a redefine whose self-reference duplicates a particle (UPA) (#253) 2026-06-24 00:06:23 +02:00
ContentNFAStateBudgetTests.swift
CoverageGateValueTypeTests.swift test(ci): add an opt-in coverage gate; close the 0% value types it surfaces 2026-06-22 16:38:30 +02:00
DTDAttributeTests.swift
DTDConditionalNotationTests.swift
DTDDefaultingTests.swift
DTDEntityDeclaredTests.swift
DTDIdentifierTests.swift
DTDLocatedContentTests.swift
DTDParameterEntityDepthTests.swift
DTDStandaloneTests.swift
DTDSubsetStrictnessTests.swift
DTDTests.swift
DTDValidationTests.swift
DTDValidityConstraintTests.swift
EncodingMismatchTests.swift
EncodingTests.swift
EntityBaseURITests.swift
EntityDecodeBulkTests.swift perf(parse): scan for entity-decoder markers at the byte level (#294) 2026-06-25 13:37:27 +02:00
EntityResolverTests.swift
EntitySplicingTests.swift
ErrataValidityTests.swift
EscapingFastPathTests.swift perf(emitting): skip escaping rebuild for values that need no escaping (#279) 2026-06-25 00:56:52 +02:00
EXSLTTests.swift
HTMLAdoptionTests.swift
HTMLDocumentTests.swift
HTMLForeignContentTests.swift
HTMLFramesetTests.swift
HTMLSelectTests.swift
HTMLTests.swift
HTMLTokenizerTests.swift
HTMLValidationTests.swift
LineEndingTests.swift
LintTests.swift
ModelTests.swift
NamespaceConstraintTests.swift
NamespaceTests.swift
OutputEncodingTests.swift
ParityEdgeTests.swift
ParserPathDifferentialTests.swift perf(parsing): skip reference decoding for ampersand-free attribute values (#278) 2026-06-25 00:17:31 +02:00
ParseTreeDirectBuildTests.swift perf(parse): build the TreeNode tree directly from the event stream (#295) 2026-06-25 14:15:57 +02:00
ParsingTests.swift
PatternTests.swift
PullPushDifferentialTests.swift
PushParserTests.swift
QualifiedNameColonHintTests.swift perf(parse): split the name prefix from a scanned colon offset (#292) 2026-06-25 12:23:53 +02:00
QuickFixTests.swift
RecoveringReaderTests.swift
RegexCategoryTests.swift fix(schema): negated character-class subtraction excludes the subtrahend (#249) 2026-06-23 03:10:45 +02:00
RegexTests.swift fix(schema): reject an unknown \p{...} category or block name (#248) 2026-06-23 02:15:26 +02:00
RelaxNGCombineTests.swift
RelaxNGCompactAnnotationTests.swift
RelaxNGCompactConcatTests.swift
RelaxNGCompactFollowAnnotationTests.swift
RelaxNGCompactParamTests.swift
RelaxNGCompactTests.swift
RelaxNGDataParamTests.swift
RelaxNGDatatypeLibraryTests.swift
RelaxNGIncludeTests.swift test(relaxng): cover include and externalRef resolution 2026-06-22 17:01:15 +02:00
RelaxNGLocatedErrorTests.swift
RelaxNGNameClassTests.swift
RelaxNGQNameTests.swift
RelaxNGSchemaCorrectnessTests.swift
RelaxNGSpecSuiteTests.swift
RelaxNGStreamingTests.swift
RelaxNGTests.swift
RelaxNGValueSpaceTests.swift
SaveOptionsTests.swift
SAXTests.swift
ScalarLexingTests.swift
SchemaAbstractXsiTypeTests.swift
SchemaAllGroupMinOccursTests.swift fix(schema): optional xs:all group requires its members when present 2026-06-22 18:29:09 +02:00
SchemaAllGroupPlacementTests.swift
SchemaAllGroupReferenceTests.swift
SchemaAnySimpleTypeFacetTests.swift
SchemaAnyTypeLaxTests.swift
SchemaAttributeDefaultUseTests.swift
SchemaAttributeLocatedDiagnosticsTests.swift
SchemaAttributeRefTests.swift
SchemaAttributeRestrictionTests.swift
SchemaAttributeUniquenessTests.swift
SchemaAttributeWildcardIntersectionTests.swift
SchemaBlockDefaultTests.swift
SchemaCircularDerivationTests.swift
SchemaComposingTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
SchemaCompositionLocatedDiagnosticsTests.swift feat(schema): locate composition/redefine-pass schema diagnostics 2026-06-21 19:41:31 +02:00
SchemaConformanceTests.swift
SchemaContainerTopLevelFormTests.swift fix(schema): reject global form in included/imported documents 2026-06-22 17:50:53 +02:00
SchemaContentDerivationLocatedTests.swift feat(schema): locate content-derivation-pass schema diagnostics 2026-06-21 17:29:41 +02:00
SchemaContentOrderTests.swift
SchemaDerivationControlTests.swift
SchemaDerivationLocatedDiagnosticsTests.swift feat(schema): locate derivation/cycle-pass schema diagnostics 2026-06-21 16:53:02 +02:00
SchemaDeterminismGroupBlowupTests.swift perf(schema): memoize group expansion in the compiled content model 2026-06-22 23:24:19 +02:00
SchemaDifferentialHarness.swift
SchemaDifferentialTests.swift
SchemaDurationFacetTests.swift
SchemaElementBlockTests.swift
SchemaElementRefApplicabilityTests.swift
SchemaExtensionAllGroupTests.swift
SchemaExtensionSubstitutionLocatedTests.swift feat(schema): locate extension/substitution-pass schema diagnostics 2026-06-21 18:35:38 +02:00
SchemaFacetApplicabilityTests.swift
SchemaFacetDefinitionTests.swift
SchemaFixedElementChildrenTests.swift
SchemaForeignNamespaceReferenceTests.swift
SchemaFuzzTests.swift test(schema): harden the streaming/tree differential over deep group chains (#246) 2026-06-23 00:09:36 +02:00
SchemaGroupRedefineRestrictionTests.swift
SchemaIDAttributeTests.swift
SchemaIdentityDefaultValueTests.swift
SchemaIdentityFieldTypeTests.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
SchemaIdentityValueEqualityTests.swift
SchemaIdentityXPathTests.swift
SchemaIDIDREFTests.swift
SchemaIDREFDefaultTests.swift fix(schema): resolve defaulted/fixed IDREF attributes against IDs 2026-06-22 18:56:36 +02:00
SchemaIDValueConstraintTests.swift
SchemaIncludeTests.swift
SchemaListFacetTests.swift
SchemaListUnionXsiTypeTests.swift
SchemaLocalElementBlockKeyTests.swift
SchemaLocatedDiagnosticsTests.swift
SchemaMixedEmptyTests.swift
SchemaMultiDocumentTests.swift
SchemaNamespacedDerivationTests.swift
SchemaNamesUPANotationLocatedTests.swift feat(schema): locate names/UPA/notation-pass schema diagnostics 2026-06-21 19:16:54 +02:00
SchemaNameUniquenessTests.swift
SchemaNestedDefinitionTests.swift
SchemaNilFixedTests.swift fix(schema): reject a nilled element with a fixed value constraint 2026-06-22 18:05:23 +02:00
SchemaNotationValidityTests.swift
SchemaParticleTypeRestrictionTests.swift
SchemaPatternFacetTests.swift fix(schema): reject an unknown \p{...} category or block name (#248) 2026-06-23 02:15:26 +02:00
SchemaProhibitedAttributeTests.swift
SchemaQNameLengthTests.swift
SchemaRedefineAttributeGroupTests.swift fix(schema): flatten redefine self-reference and exclude prohibited uses in attribute uniqueness 2026-06-22 03:52:13 +02:00
SchemaReferenceLocatedDiagnosticsTests.swift feat(schema): locate reference-resolution schema diagnostics 2026-06-21 18:09:20 +02:00
SchemaReferenceTests.swift fix(schema): an unprefixed type ref to a target-namespace type is undeclared 2026-06-21 23:17:14 +02:00
SchemaRestrictionMixedTests.swift feat(schema): locate content-derivation-pass schema diagnostics 2026-06-21 17:29:41 +02:00
SchemaSimpleContentChainTests.swift
SchemaSimpleContentFixedTests.swift
SchemaSimpleContentListTests.swift
SchemaSimpleContentRestrictionInlineTypeTests.swift
SchemaSimpleTypeFinalTests.swift
SchemaSimpleTypeLocatedDiagnosticsTests.swift
SchemaSimpleTypeRestrictionTests.swift
SchemaSimpleTypeVarietyTests.swift
SchemaStreamingValueConstraintTests.swift
SchemaStreamingXsiTypeGateTests.swift
SchemaStringWhitespaceTests.swift
SchemaStructureDerivationTests.swift
SchemaStructureLocatedDiagnosticsTests.swift
SchemaStructureTests.swift
SchemaSubstitutionBlockTests.swift
SchemaSubstitutionListUnionTests.swift
SchemaSubstitutionTypeBlockTests.swift
SchemaSubstitutionTypeTests.swift fix(schema): apply substitution-group block to a member with an inline type 2026-06-22 06:21:23 +02:00
SchemaTopLevelAttributeGroupTests.swift
SchemaTopLevelAttributeTests.swift
SchemaTopLevelElementTests.swift
SchemaTopLevelGroupTests.swift
SchematronAbstractPatternTests.swift
SchematronAbstractTests.swift
SchematronDiagnosticTests.swift
SchematronDynamicTests.swift
SchematronFunctionTests.swift
SchematronLetTests.swift
SchematronScopedLetTests.swift
SchematronTests.swift
SchemaTwoIDAttributesTests.swift
SchemaTypeExclusivityTests.swift
SchemaUnionFacetTests.swift
SchemaUserTypeValueConstraintTests.swift
SchemaValueConstraintExclusionTests.swift
SchemaValueConstraintTests.swift
SchemaValueConstraintValidityTests.swift
SchemaWhiteSpaceRestrictionTests.swift
SchemaWildcardNamespaceTests.swift
SchemaWildcardUnionExpressibilityTests.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
SchemaXSIAttributeTests.swift fix(schema): an unprefixed type ref to a target-namespace type is undeclared 2026-06-21 23:17:14 +02:00
SchemaXSITypeUnionMemberBlockTests.swift fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
SchemaXSTSDiagnosticTests.swift
SchemaXSTSRegressionTests.swift
SerializationEscapeTests.swift
SerializationOptionsTests.swift
SerializerTests.swift fix(emit): split ?> in processing-instruction data with a space (#262) 2026-06-24 03:14:01 +02:00
SourceSpanTests.swift
StreamingDecoderJPTWTests.swift test(parsing): cover streaming ISO-2022-JP and EUC-TW decode 2026-06-22 17:11:58 +02:00
StreamingDecoderTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
StreamingDTDValidationTests.swift
StreamingXSDTests.swift
StrictRecoveringDifferentialTests.swift
StrictSubsetProfileTests.swift
TextReaderBreadthTests.swift
TextReaderTests.swift
TreeNodeAdoptingInitTests.swift perf(parse): adopt prepared children when materializing the tree (#293) 2026-06-25 13:02:20 +02:00
TreeNodeEditingTests.swift
TreeNodeIdentityTests.swift
TreeNodeTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
ValidationConfigurationTests.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
ValidationFieldCoverageTests.swift
ValidationFrameworkTests.swift
ValidationRuleDTDTests.swift
ValidationRuleMiscTests.swift
ValidationRuleRegistryTests.swift
ValidationRuleStructuralTests.swift
ValidationRuleTestSupport.swift
ValidationRuleXSDTests.swift
ValidationTests.swift
ValidationWarningsTests.swift
W3CEduniSuiteTests.swift
W3CIBMSuiteTests.swift
W3CJapaneseSuiteTests.swift
W3COasisSuiteTests.swift
W3CSunSuiteTests.swift
W3CXMLSuiteTests.swift
WriterTests.swift
XalanConfSuiteTests.swift test(xslt): decode non-UTF-8 conformance sources via the library's encoding detection (#261) 2026-06-24 03:04:45 +02:00
XIncludeNegotiationTests.swift
XIncludeTests.swift
XMLCharacterTests.swift
XMLDeclarationTests.swift
XPathAxisTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XPathCompiledNodeTestTests.swift perf(xpath): compile the step node test once per query (#289) 2026-06-25 09:44:04 +02:00
XPathContextTests.swift
XPathDescendantFusionTests.swift perf(xpath): fuse // into a descendant step for non-positional predicates (#281) 2026-06-25 03:21:03 +02:00
XPathExpressionTests.swift fix(xpath): format a large integer-valued number with no decimal point (#268) 2026-06-24 04:31:19 +02:00
XPathFunctionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XPathFusedAttributeTests.swift perf(xpath): fuse the node test into the attribute traversal (#287) 2026-06-25 07:51:29 +02:00
XPathFusedDescendantTests.swift perf(xpath): fuse the node test into the descendant traversal (#286) 2026-06-25 07:05:03 +02:00
XPathNamespaceTests.swift
XPathNodeSetDedupTests.swift perf(xpath): skip node-set de-duplication where no duplicate can arise (#280) 2026-06-25 01:33:50 +02:00
XPathSingleStepOrderTests.swift perf(xpath): skip the document-order sort for an already-ordered single step (#283) 2026-06-25 05:04:00 +02:00
XPathTests.swift
XPointerRangeTests.swift
XPointerTests.swift
XSDCategoryTests.swift
XSDCompletionTests2.swift
XSDComplexTypeTests.swift
XSDCompositionTests.swift
XSDDatatypeTests.swift
XSDDerivationControlTests.swift
XSDIdentityTests.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
XSDImportTests.swift
XSDLocatedContentTests.swift
XSDNamespaceTests.swift
XSDParticleReferenceRestrictionTests.swift
XSDParticleRestrictionTests.swift fix(schema): a content-bearing derived group cannot restrict a base element 2026-06-22 19:40:57 +02:00
XSDRestrictionContentFreeOrderTests.swift
XSDSchemaTests.swift
XSDSchemaValidationTests.swift
XSDTypeResolutionTests.swift
XSDValueConstraintTests.swift
XSDWildcardTests.swift
XSLTApplyImportsTests.swift
XSLTAttributeSetTests.swift
XSLTCallTemplatePrecedenceTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTCDATASectionTests.swift
XSLTCollationTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
XSLTCompositionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTCreatedNamesTests.swift
XSLTDecimalFormatTests.swift
XSLTDoctypeOutputTests.swift fix(xslt): name the html output method doctype HTML, not the element name (closes output40/48/60) (#259) 2026-06-24 02:29:26 +02:00
XSLTDocumentBaseURITests.swift fix(xslt): resolve string-form document() against the stylesheet element's base URI (closes mdocs12/13) (#257) 2026-06-24 02:03:32 +02:00
XSLTDocumentFunctionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTExpandedQNameTests.swift fix(xslt): match template, key, attribute-set, decimal-format names by expanded QName (#255) 2026-06-24 00:44:27 +02:00
XSLTFallbackTests.swift
XSLTFunctionTests.swift
XSLTGlobalVariableTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTHTMLOutputTests.swift fix(html): percent-escape non-ASCII characters in URI-valued attributes (closes output32) (#263) 2026-06-24 03:27:49 +02:00
XSLTKeyNodeSetTests.swift fix(xslt): distribute // over union branches in an xsl:key match pattern (#272) 2026-06-24 15:27:36 +02:00
XSLTMatchCacheTests.swift
XSLTMessageTests.swift
XSLTNamespaceAliasTests.swift fix(xslt): xsl:namespace-alias keeps the literal prefix, remapping only the URI (closes namespace19/23/24/35/113) (#273) 2026-06-24 15:43:02 +02:00
XSLTNumberingTests.swift fix(xslt): count the from boundary node in xsl:number level=single when it matches count (#270) 2026-06-24 10:47:49 +02:00
XSLTOutputMethodTests.swift fix(xslt): ignore disable-output-escaping for attribute, comment, and PI values (#264) 2026-06-24 03:41:56 +02:00
XSLTParityTests.swift
XSLTParserTests.swift
XSLTPatternPriorityTests.swift fix(xslt): give an axis-prefixed match pattern its node-test default priority (#266) 2026-06-24 04:08:00 +02:00
XSLTResultFragmentTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTSortCaseOrderTests.swift
XSLTTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTWhitespaceTests.swift fix(xslt): honor xml:space=preserve when stripping stylesheet whitespace (#271) 2026-06-24 10:57:47 +02:00
XSTSDifferentialTests.swift
XSTSSuiteTests.swift fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00