Skip to content

Commit 2b329eb

Browse files
committed
Search engine tests
1 parent 9c5644d commit 2b329eb

1 file changed

Lines changed: 0 additions & 43 deletions

File tree

addons/addon-search/src/SearchEngine.test.ts

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -754,47 +754,4 @@ describe('SearchEngine', () => {
754754
});
755755
});
756756
});
757-
758-
describe('performance and stress tests', () => {
759-
it('should handle large content efficiently', async () => {
760-
const largeText = 'A'.repeat(10000) + 'target' + 'B'.repeat(10000);
761-
await writeP(terminal, largeText);
762-
763-
const start = Date.now();
764-
const result = searchEngine.find('target', 0, 0);
765-
const duration = Date.now() - start;
766-
767-
assert.deepStrictEqual(result, {
768-
term: 'target',
769-
col: 10000,
770-
row: 0,
771-
size: 6
772-
});
773-
assert.strictEqual(duration < 1000, true, 'Search should complete in reasonable time');
774-
});
775-
776-
it('should handle many search calls efficiently', async () => {
777-
await writeP(terminal, 'test1 test2 test3 test4 test5');
778-
779-
const start = Date.now();
780-
for (let i = 0; i < 100; i++) {
781-
searchEngine.find('test', 0, 0);
782-
}
783-
const duration = Date.now() - start;
784-
785-
assert.strictEqual(duration < 1000, true, 'Multiple searches should complete efficiently');
786-
});
787-
788-
it('should handle regex searches efficiently', async () => {
789-
const content = 'word1 word2 word3 word4 word5 '.repeat(100);
790-
await writeP(terminal, content);
791-
792-
const start = Date.now();
793-
const result = searchEngine.find('word\\d+', 0, 0, { regex: true });
794-
const duration = Date.now() - start;
795-
796-
assert.notStrictEqual(result, undefined);
797-
assert.strictEqual(duration < 1000, true, 'Regex search should complete in reasonable time');
798-
});
799-
});
800757
});

0 commit comments

Comments
 (0)