Skip to content

test(loop-sync): add CRLF frontmatter regression tests - #496

Merged
cobusgreyling merged 3 commits into
cobusgreyling:mainfrom
pxmpsdev:test/479-loop-sync-crlf-tests
Aug 13, 2026
Merged

test(loop-sync): add CRLF frontmatter regression tests#496
cobusgreyling merged 3 commits into
cobusgreyling:mainfrom
pxmpsdev:test/479-loop-sync-crlf-tests

Conversation

@pxmpsdev

Copy link
Copy Markdown
Contributor

Closes #479

Adds regression tests for extractFrontmatter CRLF handling (fixed in #476):

  • LF frontmatter still parses
  • CRLF frontmatter parses keys without trailing \r
  • ---hello (opening fence without newline) is rejected
  • Closing fence without newline is rejected

Exports extractFrontmatter from src/sync.ts so the tests can exercise it directly, and fixes a body-slicing off-by-one that the new tests exposed (the closing fence's newline was duplicated into the body).

cd tools/loop-sync && npm test passes (11 tests).

- body slice kept a leading newline (off-by-one) that duplicated the
  closing fence's own line break into the body
- a closing fence like '---oops' (no newline after it) was accepted as
  a valid frontmatter terminator
Export extractFrontmatter so the tests can exercise it directly. Covers
LF parsing, CRLF parsing without trailing CR, and rejection of opening
and closing fences without newlines.
@pxmpsdev
pxmpsdev force-pushed the test/479-loop-sync-crlf-tests branch from 2639491 to b3f16e8 Compare August 10, 2026 09:19
@cobusgreyling
cobusgreyling merged commit 1703e1f into cobusgreyling:main Aug 13, 2026
2 checks passed
cobusgreyling added a commit that referenced this pull request Aug 13, 2026
…order (#513)

- Issue forms as YAML (bug, pattern-request, share-story); fix share-story
  template URL; security contact on this repo
- PR template: npm monorepo checklist + 48h review SLA
- README hero: Quickstart / Contribute / Star CTAs + soft star line
- CONTRIBUTING: 48h first-response SLA
- loop-audit (and goal-audit) prebuild: build monorepo readiness-core
  sibling so `cd tools/loop-audit && npm run build` works (fixes #504)

Also notes community merges #496#500 in Help wanted.

Co-authored-by: Cobus Greyling <cobusgreyling@users.noreply.github.com>
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.

Add CRLF frontmatter regression tests for loop-sync

2 participants