Skip to content

Commit 7fc4ab5

Browse files
authored
test: compare the statusline copy path JSON-escaped in hooks.test.js (#1046)
The nudge JSON-encodes the command, which doubles Windows backslashes, so the raw-path check never matched on Windows and aborted the rest of the file. On macOS and Linux the encoded path is identical to the raw one.
1 parent f2d50c8 commit 7fc4ab5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎tests/hooks.test.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ assert.ok(
316316
// update, so the nudge points at a copy of the script in the config dir.
317317
const copyPath = path.join(customConfigDir, process.platform === 'win32' ? 'ponytail-statusline.ps1' : 'ponytail-statusline.sh');
318318
assert.ok(fs.existsSync(copyPath), 'nudge must copy the statusline script into the config dir (#1032)');
319-
assert.ok(result.stdout.includes(copyPath), 'nudge must point at the config-dir copy, not the plugin cache (#1032)');
319+
// The snippet is JSON-encoded, which doubles Windows backslashes.
320+
assert.ok(result.stdout.includes(JSON.stringify(copyPath).slice(1, -1)), 'nudge must point at the config-dir copy, not the plugin cache (#1032)');
320321
assert.ok(!result.stdout.includes(path.join(root, 'hooks')), 'nudge must not point into the versioned plugin dir (#1032)');
321322
// Later sessions refresh the copy, so script fixes ship with plugin updates.
322323
fs.writeFileSync(copyPath, 'old');

0 commit comments

Comments
 (0)