Skip to content

Commit

Permalink
Update tests for bugfix in lowlight
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 1, 2022
1 parent 4edc15d commit d93b319
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs lang-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n'),
'should highlight (lang class)'
)
Expand All @@ -158,7 +158,7 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs language-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n'),
'should highlight (language class)'
)
Expand All @@ -180,7 +180,7 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs language-javascript"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n'),
'should highlight (long name)'
)
Expand Down Expand Up @@ -320,7 +320,7 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs lang-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n'),
'should reprocess exact'
)
Expand All @@ -335,7 +335,7 @@ test('rehypeHighlight', (t) => {
'<pre><code class="lang-funkyscript">console.log(1)</code></pre>'
)
.toString(),
'<pre><code class="hljs lang-funkyscript"><span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-number">1</span>)</code></pre>',
'<pre><code class="hljs lang-funkyscript"><span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-number">1</span>)</code></pre>',
'should parse custom language'
)

Expand All @@ -348,15 +348,15 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs lang-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n')
)
.toString(),
[
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs lang-js"><span class="hljs-keyword">var</span> name = <span class="hljs-string">"World"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>)</code></pre>'
].join('\n'),
'should reprocess exact'
)
Expand Down Expand Up @@ -397,7 +397,7 @@ test('rehypeHighlight', (t) => {
'<h1>Hello World!</h1>',
'',
'<pre><code class="hljs language-javascript"><span class="hljs-meta">"use strict"</span>;',
'<span class="hljs-variable hljs-language">console</span>.<span class="hljs-title hljs-function">log</span>(<span class="hljs-string">"very strict"</span>)</code></pre>'
'<span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(<span class="hljs-string">"very strict"</span>)</code></pre>'
].join('\n'),
'should support `<br>` elements'
)
Expand Down

0 comments on commit d93b319

Please sign in to comment.