test: add ghost issues tests

This commit is contained in:
Estevão Soares dos Santos 2015-07-14 20:53:28 +01:00
parent 5d0ec964e4
commit 534c53616a
7 changed files with 32 additions and 8 deletions

4
test/bootstrap.js vendored
View File

@ -82,8 +82,8 @@
testCase.actual = beautify(testCase.actual, beauOptions);
// Normalize line returns
testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, os.EOL);
testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, os.EOL);
testCase.expected = testCase.expected.replace(/(\r\n)|\n|\r/g, '\n');
testCase.actual = testCase.actual.replace(/(\r\n)|\n|\r/g, '\n');
return testCase;
}

View File

@ -15,7 +15,7 @@
<pre><code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
</code></pre>
<pre><code class="language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
<pre><code class="html language-html">foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo
</code></pre>
<pre>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</pre>
@ -37,7 +37,7 @@
<h2 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h2>
<h3 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h3>
<h3 id="foo_bar_bazfoo_bar_baz_bar_foo_foo_barbaz_bar_baz_foo-1">foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</h3>
<ol>
<li>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</li>
@ -55,7 +55,7 @@
<hr />
<p>http://en.wikipedia.org/wiki/Tourism_in_Germany</p>
<p><a href="http://en.wikipedia.org/wiki/Tourism_in_Germany">http://en.wikipedia.org/wiki/Tourism_in_Germany</a></p>
<p><a href="http://en.wikipedia.org/wiki/Tourism_in_Germany">an example</a></p>
@ -65,11 +65,11 @@
<!-- These two cases still have bad <ems> because showdown handles them incorrectly -->
<p><code>foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo</code></p>
<p><code>foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo</code></p>
<p><img src="http://myurl.com/foo_bar_baz_bar_foo" alt="foo_bar_baz foo_bar_baz_bar_foo <em>foo_bar baz_bar</em> baz_foo" title="" /></p>
<p><img src="http://myurl.com/foo_bar_baz_bar_foo" alt="foo_bar_baz foo_bar_baz_bar_foo _foo_bar baz_bar_ baz_foo"/></p>
<p>http://myurl.com/foo_bar_baz_bar_foo</p>
<p><a href="http://myurl.com/foo_bar_baz_bar_foo">http://myurl.com/foo_bar_baz_bar_foo</a></p>
<p><a href="http://myurl.com/foo_bar_baz_bar_foo">http://myurl.com/foo_bar_baz_bar_foo</a></p>

View File

@ -25,6 +25,8 @@ describe('makeHtml() features testsuite', function () {
converter = new showdown.Converter({ghCodeBlocks: false});
} else if (testsuite[i].name === '#164.4.tasklists') {
converter = new showdown.Converter({tasklists: true});
} else if (testsuite[i].name === 'autolink_and_disallow_underscores') {
converter = new showdown.Converter({literalMidWordUnderscores: true, simplifiedAutoLink: true});
} else {
converter = new showdown.Converter();
}

View File

@ -0,0 +1,22 @@
/**
* Created by Estevao on 14-07-2015.
*/
var bootstrap = require('../bootstrap.js'),
converter = new bootstrap.showdown.Converter({
strikethrough: true,
literalMidWordUnderscores: true,
simplifiedAutoLink: true,
tables: true,
parseImgDimensions: true, //extra
tasklists: true //extra
}),
assertion = bootstrap.assertion,
testsuite = bootstrap.getTestSuite('test/ghost/');
//MD-Testsuite (borrowed from karlcow/markdown-testsuite)
describe('makeHtml() ghost testsuite', function () {
'use strict';
for (var i = 0; i < testsuite.length; ++i) {
it(testsuite[i].name, assertion(testsuite[i], converter));
}
});