mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
test: add 3 tests for replaceInFile deletion, parseSessionMetadata null fields, countInFile zero matches (Round 88)
- replaceInFile with empty replacement string verifies text deletion works - parseSessionMetadata asserts date/started/lastUpdated are null when fields absent - countInFile with valid file but non-matching pattern returns 0 Total: 824 tests
This commit is contained in:
@@ -1385,6 +1385,22 @@ src/main.ts
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
// ── Round 88: parseSessionMetadata null date/started/lastUpdated fields ──
|
||||
console.log('\nRound 88: parseSessionMetadata content lacking Date/Started/Updated fields:');
|
||||
if (test('parseSessionMetadata returns null for date, started, lastUpdated when fields absent', () => {
|
||||
const content = '# Title Only\n\n### Notes for Next Session\nSome notes\n';
|
||||
const meta = sessionManager.parseSessionMetadata(content);
|
||||
assert.strictEqual(meta.date, null,
|
||||
'date should be null when **Date:** field is absent');
|
||||
assert.strictEqual(meta.started, null,
|
||||
'started should be null when **Started:** field is absent');
|
||||
assert.strictEqual(meta.lastUpdated, null,
|
||||
'lastUpdated should be null when **Last Updated:** field is absent');
|
||||
// Confirm other fields still parse correctly
|
||||
assert.strictEqual(meta.title, 'Title Only');
|
||||
assert.strictEqual(meta.notes, 'Some notes');
|
||||
})) passed++; else failed++;
|
||||
|
||||
// Summary
|
||||
console.log(`\nResults: Passed: ${passed}, Failed: ${failed}`);
|
||||
process.exit(failed > 0 ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user