Browse Source

Add more tests

+ a benchmark case
pull/14/head
Alex Kocharin 10 years ago
parent
commit
26d1dab349
  1. 2
      benchmark/samples/inline-links-nested.md
  2. 19
      test/fixtures/remarkable/regression.txt
  3. 62
      test/fixtures/remarkable/strikeout.txt

2
benchmark/samples/inline-links-nested.md

@ -9,3 +9,5 @@ Invalid links:
[[[[[[[[[
[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [
![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![![

19
test/fixtures/remarkable/regression.txt

@ -0,0 +1,19 @@
Regression tests for link backtracking optimizations:
.
[[some unrelated text [link]
[link]: foo
.
<p>[[some unrelated text <a href="foo">link</a></p>
.
.
[[some unrelated text [[link]]
[[link]]: foo
.
<p>[[some unrelated text <a href="foo">[link]</a></p>
.

62
test/fixtures/remarkable/strikeout.txt

@ -3,3 +3,65 @@
.
<p><del>Strikeout</del></p>
.
These are not strikeouts, you have to use exactly two "~~":
.
x ~~~foo~~~
x ~~foo~~~
x ~~~foo~~
.
<p>x ~~~foo~~~</p>
<p>x ~~foo~~~</p>
<p>x ~~~foo~~</p>
.
Strikeouts have the same priority as emphases:
.
**~~test**~~
~~**test~~**
.
<p><strong>~~test</strong>~~</p>
<p><del>**test</del>**</p>
.
Strikeouts have the same priority as emphases with respect to links:
.
[~~link]()~~
~~[link~~]()
.
<p><a href="">~~link</a>~~</p>
<p>~~<a href="">link~~</a></p>
.
Strikeouts have the same priority as emphases with respect to backticks:
.
~~`code~~`
`~~code`~~
.
<p>~~<code>code~~</code></p>
<p><code>~~code</code>~~</p>
.
Nested strikeouts:
.
~~foo ~~bar~~ baz~~
~~f **o ~~o b~~ a** r~~
.
<p><del>foo <del>bar</del> baz</del></p>
<p><del>f <strong>o <del>o b</del> a</strong> r</del></p>
.
Should not have a whitespace between text and "~~":
.
foo ~~ bar ~~ baz
.
<p>foo ~~ bar ~~ baz</p>
.

Loading…
Cancel
Save