Skip to content

Commit

Permalink
Added more pathological tests.
Browse files Browse the repository at this point in the history
Tests for many emph closers without matching openers,
openers without matching closers, and similarly for links.

See #43.
  • Loading branch information
jgm committed Jun 10, 2015
1 parent 40c3e3d commit 90affae
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,30 @@ for (x = 1000; x <= 10000; x *= 10) {
expected: '<p>' + repeat('<em>a <strong>a ', x) + 'b' +
repeat(' a</strong> a</em>', x) + '</p>\n' });
}
for (x = 1000; x <= 10000; x *= 10) {
cases.push(
{ name: x + ' emph closers with no openers',
input: repeat('a_ ', x),
expected: '<p>' + repeat('a_ ', x - 1) + 'a_</p>\n' });
}
for (x = 1000; x <= 10000; x *= 10) {
cases.push(
{ name: x + ' emph openers with no closers',
input: repeat('_a ', x),
expected: '<p>' + repeat('_a ', x - 1) + '_a</p>\n' });
}
for (x = 1000; x <= 10000; x *= 10) {
cases.push(
{ name: x + ' link closers with no openers',
input: repeat('a] ', x),
expected: '<p>' + repeat('a] ', x - 1) + 'a]</p>\n' });
}
for (x = 1000; x <= 10000; x *= 10) {
cases.push(
{ name: x + ' link openers with no closers',
input: repeat('[a ', x),
expected: '<p>' + repeat('[a ', x - 1) + '[a</p>\n' });
}
for (x = 1000; x <= 10000; x *= 10) {
cases.push(
{ name: 'nested brackets ' + x + ' deep',
Expand Down

0 comments on commit 90affae

Please sign in to comment.