Skip to content

Commit 238df08

Browse files
committed
test(3.3): add correct test
1 parent be84211 commit 238df08

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"glob": "^7.0.0",
4242
"mocha": "^2.3.3",
4343
"textlint": "^5.5.2-0",
44-
"textlint-tester": "^0.5.1"
44+
"textlint-tester": "^1.0.0"
4545
},
4646
"dependencies": {
4747
"analyze-desumasu-dearu": "^2.1.2",

src/2.1.8.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function reporter(context) {
2020
return;
2121
}
2222
const text = getSource(node);
23-
const matchRegExp = /([-]+)/
23+
const matchRegExp = /([-]+)/;
2424
matchCaptureGroupAll(text, matchRegExp).forEach(match => {
2525
const {index, text} = match;
2626
report(node, {

test/3.3-test.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,37 @@ tester.run("3.3.かっこ類と隣接する文字の間のスペースの有無"
2020
text: "これは 「ダメ」です",
2121
output: "これは「ダメ」です",
2222
errors: [
23-
{message: "かっこの外側、内側ともにスペースを入れません。"}
23+
{
24+
message: "かっこの外側、内側ともにスペースを入れません。",
25+
line: 1,
26+
column: 4
27+
}
28+
]
29+
},
30+
{
31+
text: // 改行はスペースではないとする
32+
`
33+
実装をみてもらうと分かりますが、JavaScriptの\`prototype\`の仕組みをそのまま利用しています。
34+
そのため、特別な実装は必要なく
35+
「拡張する時は\`calculator.prototype\`の代わりに\`calculator.fn\`を拡張してください」
36+
というルールがあるだけとも言えます。
37+
`,
38+
output: `
39+
実装をみてもらうと分かりますが、JavaScriptの\`prototype\`の仕組みをそのまま利用しています。
40+
そのため、特別な実装は必要なく「拡張する時は\`calculator.prototype\`の代わりに\`calculator.fn\`を拡張してください」というルールがあるだけとも言えます。
41+
`,
42+
errors: [
43+
{
44+
message: "かっこの外側、内側ともにスペースを入れません。",
45+
line: 2,
46+
column: 15
47+
},
48+
{
49+
message: "かっこの外側、内側ともにスペースを入れません。",
50+
line: 4,
51+
column: 15
52+
}
53+
2454
]
2555
}
2656
]

0 commit comments

Comments
 (0)