PureXML/Tests
Mihaela Mihaljevic 191d2245de feat(parsing): streaming honors the declared encoding; streaming ISO-2022-JP
The streaming decoder previously selected an encoding only from a byte-order
mark or the UTF sniff, so its single-byte and CJK decode paths were latent. It
now reads the encoding from the XML declaration (the libxml2 behavior) when
there is no BOM, activating those paths over an incremental byte source. Add
the streaming form of ISO-2022-JP, carrying the stateful mode across reads
(extracted to its own file to stay under the type-body cap). A test asserts
streaming agrees with whole-buffer decode for a single-byte (ISO-8859-1), a
CJK (Shift_JIS), and an ISO-2022-JP document.

Part of #108, #105
2026-06-09 17:33:52 +02:00
..
Fixtures chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
CanonicalPrefixRewriteTests.swift feat(canonical): C14N 2.0 sequential prefix rewrite, QName-aware values, node-set selection (#85) 2026-06-09 04:06:02 +02:00
CanonicalSelectionTests.swift feat(canonical): C14N 2.0 sequential prefix rewrite, QName-aware values, node-set selection (#85) 2026-06-09 04:06:02 +02:00
CanonicalSubsetTests.swift feat(canonical): node-subset C14N with ancestor namespace and xml:* inheritance (#85) 2026-06-09 03:55:54 +02:00
CanonicalTests.swift feat(canonical): Canonical XML (C14N) serialization 2026-06-08 06:13:02 +02:00
CatalogBaseURITests.swift feat(catalog): xml:base and RFC 3986 relative-URI resolution of entry URIs 2026-06-08 16:19:45 +02:00
CatalogGroupPreferTests.swift feat(catalog): honor group-level prefer override 2026-06-08 18:05:03 +02:00
CatalogSGMLTests.swift feat(catalog): SGML Open (TR 9401) catalog format 2026-06-08 17:03:06 +02:00
CatalogSuffixPreferTests.swift feat(catalog): systemSuffix/uriSuffix entries and the prefer attribute 2026-06-08 15:31:10 +02:00
CatalogTests.swift feat(catalog): OASIS XML Catalog resolution 2026-06-08 06:03:02 +02:00
DTDAttributeTests.swift refactor(validation): migrate DTD validation onto the framework 2026-06-08 12:36:56 +02:00
DTDConditionalNotationTests.swift feat(dtd): conditional sections, notations, NDATA, external parameter entities 2026-06-08 14:39:42 +02:00
DTDDefaultingTests.swift feat(dtd): conditional sections, notations, NDATA, external parameter entities 2026-06-08 14:39:42 +02:00
DTDIdentifierTests.swift refactor(validation): migrate DTD validation onto the framework 2026-06-08 12:36:56 +02:00
DTDLocatedContentTests.swift feat(dtd): located content-model errors with recovery hints 2026-06-09 00:59:25 +02:00
DTDTests.swift feat(parser): optional DTD with internal entities and billion-laughs defense 2026-06-08 01:17:09 +02:00
DTDValidationTests.swift refactor(validation): migrate DTD validation onto the framework 2026-06-08 12:36:56 +02:00
EncodingTests.swift feat(parsing): streaming honors the declared encoding; streaming ISO-2022-JP 2026-06-09 17:33:52 +02:00
EntityResolverTests.swift feat(dtd): external and parameter entities, secure by default 2026-06-08 03:08:20 +02:00
HTMLAdoptionTests.swift feat(html): adoption agency algorithm and active formatting elements (#83) 2026-06-09 05:46:12 +02:00
HTMLDocumentTests.swift fix(html): keep template content nested instead of splitting to body (#83) 2026-06-09 06:21:10 +02:00
HTMLForeignContentTests.swift feat(html): SVG HTML integration points switch back to HTML namespace (#83) 2026-06-09 06:06:54 +02:00
HTMLFramesetTests.swift feat(html): frameset documents and void frame element (#83) 2026-06-09 06:17:55 +02:00
HTMLSelectTests.swift feat(html): in-select-in-table closes select on table tags (#83) 2026-06-09 06:37:35 +02:00
HTMLTests.swift feat(html): lenient HTML parser and serializer 2026-06-08 07:12:42 +02:00
HTMLTokenizerTests.swift feat(html): vendor the complete WHATWG named entity set (#84) 2026-06-09 07:45:55 +02:00
HTMLValidationTests.swift feat(html): conformance validator as composable Validation rules 2026-06-09 04:39:03 +02:00
LineEndingTests.swift feat(parsing): line-ending normalization and XML 1.1 line terminators 2026-06-08 15:07:21 +02:00
LintTests.swift feat(editor): unified lint surface merging parse and validation diagnostics 2026-06-08 13:18:29 +02:00
ModelTests.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
NamespaceTests.swift feat(parser): resolve XML namespaces at the start-element boundary 2026-06-08 01:03:29 +02:00
OutputEncodingTests.swift feat(emitting): CJK output encodings, closing output-encoding parity 2026-06-09 09:41:28 +02:00
ParityEdgeTests.swift feat(parity): C14N 2.0 text trimming, catalog delegation, XPath number formatting 2026-06-08 09:37:16 +02:00
ParsingTests.swift feat(parser): add bounded-by-default limits (depth, name, content) 2026-06-08 00:40:34 +02:00
PatternTests.swift feat(pattern): streaming xmlPattern matching 2026-06-08 05:49:13 +02:00
PushParserTests.swift feat(parsing): resumable push / feed streaming API 2026-06-08 07:21:22 +02:00
QuickFixTests.swift feat(editor): structured quick-fixes from completions 2026-06-08 13:35:33 +02:00
RecoveringReaderTests.swift feat(parsing): in-reader recovery keeps elements and pops to matching tags 2026-06-08 12:24:43 +02:00
RegexCategoryTests.swift feat(regex): Unicode category escapes and character-class subtraction 2026-06-08 15:15:46 +02:00
RegexTests.swift feat(regex): XML Schema regular-expression engine 2026-06-08 06:18:50 +02:00
RelaxNGCombineTests.swift feat(relaxng): combine on define (choice/interleave merging) 2026-06-08 16:03:39 +02:00
RelaxNGCompactAnnotationTests.swift feat(relaxng): handle RNC annotations and div grouping 2026-06-08 17:12:35 +02:00
RelaxNGCompactConcatTests.swift feat(relaxng): fold RNC ~ string concatenation 2026-06-08 17:38:58 +02:00
RelaxNGCompactFollowAnnotationTests.swift feat(relaxng): skip RNC >> follow-annotations, completing #79 2026-06-09 03:20:47 +02:00
RelaxNGCompactParamTests.swift feat(relaxng): compact-syntax datatype parameter blocks 2026-06-08 16:55:57 +02:00
RelaxNGCompactTests.swift feat(relaxng): add compact syntax (RNC) and include/externalRef 2026-06-08 09:13:09 +02:00
RelaxNGDataParamTests.swift feat(relaxng): resolve datatypeLibrary and nsName subtraction 2026-06-08 17:21:49 +02:00
RelaxNGDatatypeLibraryTests.swift feat(relaxng): resolve datatypeLibrary and nsName subtraction 2026-06-08 17:21:49 +02:00
RelaxNGLocatedErrorTests.swift feat(relaxng): distinguish undeclared attribute from invalid value 2026-06-09 01:11:54 +02:00
RelaxNGNameClassTests.swift feat(relaxng): compact name-class subtraction (* - name) 2026-06-08 16:58:24 +02:00
RelaxNGStreamingTests.swift feat(validation): streaming RELAX NG validation 2026-06-09 10:35:42 +02:00
RelaxNGTests.swift feat(relaxng): resolve datatypeLibrary and nsName subtraction 2026-06-08 17:21:49 +02:00
RelaxNGValueSpaceTests.swift feat(relaxng): compare typed <value> in the datatype value space 2026-06-08 17:36:16 +02:00
SaveOptionsTests.swift feat(emit): XML declaration save-option parity 2026-06-08 02:57:27 +02:00
SAXTests.swift feat(parsing): add SAX2 push-callback API 2026-06-08 02:26:04 +02:00
SchemaConformanceTests.swift test(schema): schema conformance fixtures, completing XSD and RELAX NG 2026-06-08 06:52:43 +02:00
SchematronAbstractPatternTests.swift feat(schematron): instantiate abstract patterns with is-a/param 2026-06-08 17:58:33 +02:00
SchematronAbstractTests.swift feat(schematron): abstract rules and extends 2026-06-08 16:26:30 +02:00
SchematronDiagnosticTests.swift feat(schematron): diagnostics 2026-06-08 16:30:13 +02:00
SchematronDynamicTests.swift feat(schematron): dynamic message content and phase support 2026-06-08 15:45:27 +02:00
SchematronFunctionTests.swift feat(schematron): support key(), document(), and current() in tests 2026-06-09 03:30:43 +02:00
SchematronLetTests.swift feat(schematron): rule-level let variable bindings 2026-06-08 16:23:26 +02:00
SchematronScopedLetTests.swift feat(schematron): schema- and pattern-level let 2026-06-08 16:52:16 +02:00
SchematronTests.swift refactor(validation): migrate Schematron, retire Issue 2026-06-08 12:49:19 +02:00
SerializationEscapeTests.swift feat(emitting): textEscaping round-trip option to preserve carriage returns (#91) 2026-06-09 03:48:20 +02:00
SerializationOptionsTests.swift feat(emitting): attribute quote style, line endings, xml:space, writer namespaces 2026-06-08 15:24:49 +02:00
SerializerTests.swift refactor(emitter): make the serializer iterative and fix mixed content 2026-06-08 00:31:05 +02:00
SourceSpanTests.swift feat(editor): source spans on the tree, mapping findings to positions 2026-06-08 13:14:29 +02:00
StreamingDTDValidationTests.swift feat(validation): streaming DTD ID/IDREF integrity 2026-06-09 10:21:20 +02:00
StreamingXSDTests.swift feat(validation): streaming XSD validation, completing #107 2026-06-09 16:52:17 +02:00
TextReaderBreadthTests.swift feat(parsing): xmlReader breadth: attribute navigation, namespaces, lang, position 2026-06-08 15:01:48 +02:00
TextReaderTests.swift feat(parse): xmlTextReader pull cursor 2026-06-08 03:18:00 +02:00
TreeNodeEditingTests.swift feat(model): TreeNode editing helpers (attributes, shallow copy, order, normalize) 2026-06-08 15:19:33 +02:00
TreeNodeIdentityTests.swift feat(model): first-class doctype/entity-reference/namespace nodes, ownerDocument, adoption (#90) 2026-06-09 03:43:24 +02:00
TreeNodeTests.swift feat(model): mutable parent-aware tree (libxml2 tree.h parity) 2026-06-08 03:13:59 +02:00
ValidationFrameworkTests.swift test(validation): cover the Bool forms of the && and || combinators 2026-06-09 09:08:27 +02:00
ValidationRuleTests.swift refactor(validation): decompose DTD attribute checks into per-constraint rules (#101) 2026-06-09 04:28:03 +02:00
ValidationTests.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
WriterTests.swift feat(emitting): add an incremental XML writer (xmlTextWriter) 2026-06-08 02:32:39 +02:00
XIncludeNegotiationTests.swift feat(xinclude): content-negotiation hints, cycle detection, text+fragment 2026-06-08 15:52:18 +02:00
XIncludeTests.swift feat(xinclude): range inclusion via XPointer range model (#87) 2026-06-09 04:19:38 +02:00
XMLCharacterTests.swift feat(parsing): spec-exact XML character classification (chvalid parity) 2026-06-08 02:52:42 +02:00
XMLDeclarationTests.swift feat(parsing): surface the XML declaration (version, encoding, standalone) 2026-06-08 14:53:04 +02:00
XPathAxisTests.swift feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
XPathContextTests.swift feat(xpath): explicit evaluation context entry point 2026-06-08 05:40:52 +02:00
XPathExpressionTests.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
XPathFunctionTests.swift feat(xpath): full XPath 1.0 function library 2026-06-08 05:38:39 +02:00
XPathNamespaceTests.swift feat(xpath): eval-time namespace context and XPointer xmlns()/xpath1() schemes 2026-06-08 16:00:15 +02:00
XPathTests.swift feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
XPointerRangeTests.swift feat(xpointer): range(), range-to(), and string-range() schemes (#88) 2026-06-09 04:16:23 +02:00
XPointerTests.swift feat(xpointer): element() and xpointer() schemes 2026-06-08 05:52:23 +02:00
XSDCategoryTests.swift feat(xsd): located, recovering content-model errors 2026-06-09 00:55:17 +02:00
XSDCompletionTests2.swift feat(editor): schema-driven completions and what-is-missing 2026-06-08 13:27:37 +02:00
XSDComplexTypeTests.swift refactor(validation): migrate XSD validation onto the framework 2026-06-08 12:43:20 +02:00
XSDCompositionTests.swift refactor(validation): migrate XSD validation onto the framework 2026-06-08 12:43:20 +02:00
XSDDatatypeTests.swift feat(schema): XSD simple-type datatype library with facets 2026-06-08 06:29:37 +02:00
XSDDerivationControlTests.swift feat(schema): XSD derivation control (abstract, block, final, redefine) 2026-06-08 14:14:23 +02:00
XSDIdentityTests.swift test(xsd): prove identity-error location at full selector depth 2026-06-09 09:02:41 +02:00
XSDImportTests.swift feat(schema): XSD derivation control (abstract, block, final, redefine) 2026-06-08 14:14:23 +02:00
XSDLocatedContentTests.swift feat(xsd): located, recovering content-model errors 2026-06-09 00:55:17 +02:00
XSDNamespaceTests.swift feat(schema): XSD namespace qualification and xs:all constraints 2026-06-08 14:24:17 +02:00
XSDSchemaTests.swift refactor(validation): migrate XSD validation onto the framework 2026-06-08 12:43:20 +02:00
XSDValueConstraintTests.swift feat(xsd): xsi:nil/nillable and fixed/default value constraints 2026-06-08 13:03:06 +02:00
XSDWildcardTests.swift feat(schema): XSD wildcards and list built-in datatypes 2026-06-08 13:53:22 +02:00
XSLTApplyImportsTests.swift feat(xslt): implement xsl:apply-imports 2026-06-09 01:49:33 +02:00
XSLTAttributeSetTests.swift feat(xslt): implement xsl:attribute-set and use-attribute-sets 2026-06-09 01:39:45 +02:00
XSLTCDATASectionTests.swift feat(xslt): implement xsl:output cdata-section-elements 2026-06-09 02:58:34 +02:00
XSLTDecimalFormatTests.swift feat(xslt): implement xsl:decimal-format for format-number 2026-06-09 01:59:37 +02:00
XSLTDoctypeOutputTests.swift feat(xslt): emit xsl:output doctype-public/doctype-system 2026-06-09 02:53:50 +02:00
XSLTDocumentFunctionTests.swift feat(xslt): document() fragments and base-URI resolution, completing #82 2026-06-09 03:12:49 +02:00
XSLTFallbackTests.swift feat(xslt): implement xsl:fallback for forwards-compatible processing 2026-06-09 01:52:21 +02:00
XSLTFunctionTests.swift feat(xslt): add generate-id, system-property, *-available functions 2026-06-09 02:20:36 +02:00
XSLTHTMLOutputTests.swift feat(xslt): serialize method=html output by the HTML rules 2026-06-09 02:48:00 +02:00
XSLTKeyNodeSetTests.swift feat(xslt): key() over a node-set second argument 2026-06-09 02:50:24 +02:00
XSLTMessageTests.swift feat(xslt): implement xsl:message with terminate 2026-06-09 01:29:37 +02:00
XSLTNamespaceAliasTests.swift feat(xslt): implement xsl:namespace-alias, completing #81 2026-06-09 02:10:16 +02:00
XSLTParityTests.swift feat(xslt): add xsl:include/import, xsl:output, comment, and processing-instruction 2026-06-08 08:08:38 +02:00
XSLTParserTests.swift feat(xslt): implement xsl:attribute-set and use-attribute-sets 2026-06-09 01:39:45 +02:00
XSLTResultFragmentTests.swift feat(xslt): make result-tree fragments usable as node-sets 2026-06-09 03:04:56 +02:00
XSLTSortCaseOrderTests.swift feat(xslt): implement xsl:sort case-order 2026-06-09 02:37:43 +02:00
XSLTTests.swift feat(xslt): add xsl:include/import, xsl:output, comment, and processing-instruction 2026-06-08 08:08:38 +02:00
XSLTWhitespaceTests.swift feat(xslt): implement xsl:strip-space and xsl:preserve-space 2026-06-09 01:22:59 +02:00