Skip to content

Add edge case tests for builder and parser#4

Merged
paustint merged 2 commits intomainfrom
feat/numeric-entities
Apr 2, 2026
Merged

Add edge case tests for builder and parser#4
paustint merged 2 commits intomainfrom
feat/numeric-entities

Conversation

@paustint
Copy link
Copy Markdown
Contributor

@paustint paustint commented Apr 2, 2026

Introduce tests to validate the handling of special characters, numeric entities, and malformed XML in the builder and parser functions. These tests ensure robustness against various edge cases.

…racters, numeric entities, and malformed XML
Copilot AI review requested due to automatic review settings April 2, 2026 02:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional edge-case coverage (and supporting parser changes) to improve robustness of the XML parser/builder when encountering numeric entities and malformed inputs.

Changes:

  • Extend entity decoding to support numeric character references (&#...;, &#x...;).
  • Add a parser guard to avoid stack underflow on extra closing tags.
  • Introduce extensive new edge-case tests for parse() and build() (entities, malformed XML, whitespace/CDATA/attributes, large payloads).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/parse.ts Adds numeric entity decoding and a guard for extra closing tags during parsing.
src/__tests__/parse.test.ts Adds many new parser edge-case tests (entities, malformed XML, whitespace/CDATA, attributes, large payloads).
src/__tests__/build.test.ts Adds builder edge-case tests for escaping, deep nesting, arrays, falsy primitives, and empty structures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paustint paustint force-pushed the feat/numeric-entities branch from 25ca680 to e3c0773 Compare April 2, 2026 02:50
@paustint paustint merged commit 456ae59 into main Apr 2, 2026
3 checks passed
@paustint paustint deleted the feat/numeric-entities branch April 2, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants