Skip to content
This repository was archived by the owner on Jul 14, 2020. It is now read-only.

Commit 21e6176

Browse files
committed
#8 添加简单测试
1 parent 2699d89 commit 21e6176

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/suite/extension.test.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@ const { before } = require('mocha');
44
// You can import and use all API from the 'vscode' module
55
// as well as import your extension to test it
66
const vscode = require('vscode');
7-
// const myExtension = require('../extension');
7+
// const 补全实现 = require('../../补全实现') // TODO: 应直接引用模块
8+
// 拷贝自"补全实现"
9+
const 标识符模式 = /(-?\d*\.\d\w*)|([^\`\~\!\@\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s·ˉˇ¨]+)/g;
810

911
suite('Extension Test Suite', () => {
1012
before(() => {
1113
vscode.window.showInformationMessage('Start all tests.');
1214
});
1315

14-
test('Sample test', () => {
15-
assert.equal(-1, [1, 2, 3].indexOf(5));
16-
assert.equal(-1, [1, 2, 3].indexOf(0));
16+
test('标识符识别', () => {
17+
assert.deepEqual("量 - 1".match(标识符模式), ["量", "-", "1"]);
18+
19+
// 复现 https://github.com/program-in-chinese/vscode_Chinese_Input_Assistant/issues/8
20+
assert.deepEqual("量-1".match(标识符模式), ["量-1"], "现状有误");
21+
// TODO: 下面应通过
22+
assert.deepEqual("量-1".match(标识符模式), ["量", "-", "1"], "与-相连");
1723
});
1824
});

0 commit comments

Comments
 (0)