summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-03-18 20:05:11 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-03-18 20:05:11 +0900
commit45e8331e261244628b134a18e3d0fbe0ebb3a7dc (patch)
tree44ac1719fcea0a61c33698b23fb89400141e00d9 /test
parentBetter notification (diff)
downloadmisskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.gz
misskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.bz2
misskey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.zip
:sushi:
Closes #12, #227 and #58
Diffstat (limited to 'test')
-rw-r--r--test/text.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/text.js b/test/text.js
index e4c72560f0..49e2f02b5d 100644
--- a/test/text.js
+++ b/test/text.js
@@ -4,8 +4,8 @@
const assert = require('assert');
-const analyze = require('../src/common/text');
-const syntaxhighlighter = require('../src/common/text/core/syntax-highlighter');
+const analyze = require('../built/api/common/text').default;
+const syntaxhighlighter = require('../built/api/common/text/core/syntax-highlighter').default;
describe('Text', () => {
it('is correctly analyzed', () => {
@@ -90,6 +90,14 @@ describe('Text', () => {
});
describe('syntax highlighting', () => {
+ it('comment', () => {
+ const html1 = syntaxhighlighter('// Strawberry pasta');
+ assert.equal(html1, '<span class="comment">// Strawberry pasta</span>');
+
+ const html2 = syntaxhighlighter('x // x\ny // y');
+ assert.equal(html2, 'x <span class="comment">// x\n</span>y <span class="comment">// y</span>');
+ });
+
it('regexp', () => {
const html = syntaxhighlighter('/.*/');
assert.equal(html, '<span class="regexp">/.*/</span>');