Browse Source

Add new pathological test from cmark upstream (#1008)

pull/1004/head
Michael Howell 10 months ago
committed by GitHub
parent
commit
806beade25
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      test/pathological.json
  2. 16
      test/pathological.mjs

2
test/pathological.json

@ -1 +1 @@
{ "md5": "68c7c28fe0d4a34367f27dcbceec9fed" } { "md5": "80e12450752e4667b3656fa2cd12e9d5" }

16
test/pathological.mjs

@ -114,6 +114,10 @@ describe('Pathological sequences speed', () => {
await test_pattern(Array(1000).fill(0).map(function (_, x) { return ' '.repeat(x) + '* a\n' }).join('')) await test_pattern(Array(1000).fill(0).map(function (_, x) { return ' '.repeat(x) + '* a\n' }).join(''))
}) })
it('U+0000 in input', async () => {
await test_pattern('abc\u0000de\u0000'.repeat(100000))
})
it('backticks', async () => { it('backticks', async () => {
await test_pattern(Array(3000).fill(0).map(function (_, x) { return 'e' + '`'.repeat(x) }).join('')) await test_pattern(Array(3000).fill(0).map(function (_, x) { return 'e' + '`'.repeat(x) }).join(''))
}) })
@ -129,6 +133,18 @@ describe('Pathological sequences speed', () => {
it('unclosed <!--', async () => { it('unclosed <!--', async () => {
await test_pattern('</' + '<!--'.repeat(100000)) await test_pattern('</' + '<!--'.repeat(100000))
}) })
it('empty lines in deeply nested lists', async () => {
await test_pattern('- '.repeat(30000) + 'x' + '\n'.repeat(30000))
})
it('empty lines in deeply nested lists in blockquote', async () => {
await test_pattern('> ' + '- '.repeat(30000) + 'x\n' + '>\n'.repeat(30000))
})
it('emph in deep blockquote', async () => {
await test_pattern('>'.repeat(100000) + 'a*'.repeat(100000))
})
}) })
describe('Markdown-it', () => { describe('Markdown-it', () => {

Loading…
Cancel
Save