Skip to content

Add tests for MarkdownIt error guards and common.utils branches - #501

Open
sohams5002 wants to merge 4 commits into
executablebooks:masterfrom
sohams5002:test-utils-and-main-guards
Open

sohams5002 wants to merge 4 commits into
executablebooks:masterfrom
sohams5002:test-utils-and-main-guards

Conversation

@sohams5002

Copy link
Copy Markdown

Adds unit tests for previously uncovered branches, in the same style as #498:

tests/test_api/test_utils.py (new):

  • isValidEntityCode: invalid ranges (0xFDD0-0xFDEF, 0xFFFE/0xFFFF endings, 0x0B, 0x0E-0x1F, 0x7F-0x9F) and valid boundary codes
  • arrayReplaceAt, stripEscape
  • isWhiteSpace for the Zs separator range 0x2000-0x200A
  • unescapeAll with a decimal numeric entity (the base-10 branch of replaceEntityPattern)

tests/test_api/test_main.py:

  • TypeError when options_update is passed positionally as a non-mapping (the renderer_cls signature-change guard)
  • KeyError for an unknown preset name, ValueError for an empty config
  • configure() with a components config
  • add_render_rule when the renderer output format matches
  • TypeError guards in parse/parseInline for non-mapping env and non-string src

All 1187 tests pass locally; ruff check and ruff format are clean.

This branch has not been deployed

No deployments
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.

1 participant