Skip to content

test(fix): add CRLF line-ending coverage for name-drift rewrite#22

Merged
protosphinx merged 1 commit into
mainfrom
bot/fix-crlf-coverage
May 31, 2026
Merged

test(fix): add CRLF line-ending coverage for name-drift rewrite#22
protosphinx merged 1 commit into
mainfrom
bot/fix-crlf-coverage

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

fix.ts uses the same \r?\n regex pattern as parse.ts to handle Windows CRLF line endings in skill files. parse.test.ts already has a CRLF test pinning that behavior, but fix.test.ts has zero CRLF coverage. If the regex in rewriteFrontmatterName regressed to \n-only, no test would catch it.

What

Three new test cases appended to test/fix.test.ts:

  • fixes name-drift on a file with CRLF line endings: writes a CRLF skill file, runs applyFixes, confirms fixed === 1 and the new name appears in the rewritten content.
  • preserves body line endings after fixing CRLF frontmatter: confirms the \r\n sequences in the body are untouched after the frontmatter rewrite (only the frontmatter delimiters are normalized to LF).
  • skips a CRLF file when the name field is absent: confirms fixed === 0, skipped === 1 and the file is unchanged when there is no name: key to rewrite.

No source changes. Test-only.

Tests

  • All three new cases exercise applyFixes via real tmpdir files, matching the pattern of the existing fix.test.ts suite.
  • Existing 8 tests are unchanged.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

@protosphinx protosphinx added the automated Opened by the daily bot label May 31, 2026 — with Claude
@protosphinx protosphinx merged commit cfacc7b into main May 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant