Skip to content

test: add roundtrip consistency tests#37

Merged
luojiyin1987 merged 1 commit into
masterfrom
test/roundtrip
Jul 1, 2026
Merged

test: add roundtrip consistency tests#37
luojiyin1987 merged 1 commit into
masterfrom
test/roundtrip

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

Closes #31

Changes

  • Add __tests__/roundtrip.spec.ts with 10 test cases covering:
    • Basic markdown (heading, paragraph, list)
    • GFM table
    • GFM task list
    • GFM strikethrough
    • Frontmatter
    • Block math
    • Inline math
    • Container directive
    • Leaf directive
    • Mixed content

Implementation

  • stripPosition helper removes position info before comparison
  • assertRoundtrip verifies: parse → stringify → parse produces equivalent AST

Verification

pnpm run build && pnpm test

All 46 tests pass.

@luojiyin1987 luojiyin1987 merged commit 4d6a8c4 into master Jul 1, 2026
13 checks passed
@luojiyin1987 luojiyin1987 deleted the test/roundtrip branch July 1, 2026 15:45
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.

test: 添加 roundtrip 一致性测试(parse → stringify → parse)

1 participant