소스 검색

test: add ghost issues tests

Estevão Soares dos Santos 10 년 전
부모
커밋
534c53616a
7개의 변경된 파일32개의 추가작업 그리고 8개의 파일을 삭제
  1. 2 2
      test/bootstrap.js
  2. 0 0
      test/ghost/markdown-magic.html
  3. 0 0
      test/ghost/markdown-magic.md
  4. 6 6
      test/ghost/underscore.html
  5. 0 0
      test/ghost/underscore.md
  6. 2 0
      test/node/testsuite.features.js
  7. 22 0
      test/node/testsuite.ghost.js

+ 2 - 2
test/bootstrap.js

@@ -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;
   }

+ 0 - 0
test/extensions/ghostgfm/markdown-magic.html → test/ghost/markdown-magic.html


+ 0 - 0
test/extensions/ghostgfm/markdown-magic.md → test/ghost/markdown-magic.md


+ 6 - 6
test/extensions/underscore/underscore.html → test/ghost/underscore.html

@@ -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>
 

+ 0 - 0
test/extensions/underscore/underscore.md → test/ghost/underscore.md


+ 2 - 0
test/node/testsuite.features.js

@@ -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();
     }

+ 22 - 0
test/node/testsuite.ghost.js

@@ -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));
+  }
+});