The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/message-parser/tests/skip-flags-regression.spec.ts

15 lines
521 B

import { parse } from '../src';
describe('Skip Flags Regression (Complexity Audit)', () => {
it('should parse nested formatting across multiple depths without throwing', () => {
for (let d = 1; d <= 50; d++) {
const input = `${'*'.repeat(d)}text${'*'.repeat(d)}`;
expect(() => parse(input)).not.toThrow();
}
});
it('should handle pathological unmatched markers without crashing', () => {
const pathological = '*_~*_~*_~*_~*_~ hello'.repeat(5);
expect(() => parse(pathological)).not.toThrow();
});
});