summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-06-23 19:31:28 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-06-23 19:31:28 +0900
commite4aa00315758c0d7490de5232b60c36db2bd0b98 (patch)
treee789ec4352683463780b97bb9bbbe0df4e4dc939 /test
parentFix (diff)
downloadsharkey-e4aa00315758c0d7490de5232b60c36db2bd0b98.tar.gz
sharkey-e4aa00315758c0d7490de5232b60c36db2bd0b98.tar.bz2
sharkey-e4aa00315758c0d7490de5232b60c36db2bd0b98.zip
MFM: Improve search syntax
Diffstat (limited to 'test')
-rw-r--r--test/mfm.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/mfm.ts b/test/mfm.ts
index de722bffb3..f7fa1c0f5d 100644
--- a/test/mfm.ts
+++ b/test/mfm.ts
@@ -93,6 +93,28 @@ describe('Text', () => {
assert.equal(tokens[0].type, 'inline-code');
assert.equal(tokens[0].content, '`var x = "Strawberry Pasta";`');
});
+
+ it('search', () => {
+ const tokens1 = analyze('a b c 検索');
+ assert.deepEqual([
+ { type: 'search', content: 'a b c 検索', query: 'a b c'}
+ ], tokens1);
+
+ const tokens2 = analyze('a b c Search');
+ assert.deepEqual([
+ { type: 'search', content: 'a b c Search', query: 'a b c'}
+ ], tokens2);
+
+ const tokens3 = analyze('a b c search');
+ assert.deepEqual([
+ { type: 'search', content: 'a b c search', query: 'a b c'}
+ ], tokens3);
+
+ const tokens4 = analyze('a b c SEARCH');
+ assert.deepEqual([
+ { type: 'search', content: 'a b c SEARCH', query: 'a b c'}
+ ], tokens4);
+ });
});
describe('syntax highlighting', () => {