Repository navigation
test: compare the statusline copy path JSON-escaped in hooks.test.js - #1046
Merged
DietrichGebert merged 2 commits intoOct 13, 2026
Merged
DietrichGebert merged 2 commits into
DietrichGebert merged 2 commits into
Conversation
The nudge embeds the script path in a JSON snippet, so on Windows its backslashes are doubled. The DietrichGebert#1032 assertion looked for the raw path and failed on win32, which also skipped every assertion after it. Compare against the JSON-encoded form instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
|
Thanks! Checked it: on Windows the hook prints the path JSON-encoded, so the old check never matched and skipped the rest of the file; on macOS and Linux nothing changes. Merged. |
Merged
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tests/hooks.test.jsfailed on Windows at the #1032 assertion ("nudge must point at the config-dir copy, not the plugin cache").Why
The statusline nudge embeds the script path in a JSON snippet (
JSON.stringify(command)), so on win32 the backslashes are doubled (C:\\Users\\...\\ponytail-statusline.ps1). The assertion searched stdout for the raw path, so it never matched on Windows. Because it is a plainassert.okin a top-level script, the failure also skipped every assertion after it (the broken-statusLine and spaced-path cases).The hook output is correct; only the test was POSIX-only.
Change
Compare against the JSON-encoded form of the path:
JSON.stringify(copyPath).slice(1, -1). On POSIX this is identical to the raw path, so behavior there is unchanged.Checks
On Windows 11, Node 24:
npm test: 125 pass, 0 fail, 2 skipped (main suite); 28/28 (pi-extension)node scripts/check-rule-copies.js: oknode scripts/check-versions.js: ok🤖 Generated with Claude Code