Skip to content

Commit 5ea652c

Browse files
committed
add test for #1892
1 parent 04aa814 commit 5ea652c

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"build": "tsdown",
2424
"prepare": "npm run build",
2525
"test": "node --experimental-default-config-file --test --experimental-test-coverage",
26-
"test:update": "npm test -- --experimental-test-snapshots",
26+
"test:update": "npm test -- --test-update-snapshots",
2727
"lint": "npm run lint:biome && npm run lint:tsc",
2828
"lint:biome": "biome check .",
2929
"lint:tsc": "tsc -p ./tsconfig.lint.json",

test/line/formula.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ describe("formula", () => {
1717
it("Formula includes [] without tail half-space", ({ assert }) => {
1818
assert.snapshot(parse("[$ [x]]", { hasTitle: false }));
1919
});
20+
21+
// ref. https://github.com/progfay/scrapbox-parser/issues/1892
22+
it("Formula followed immediately by a decoration notation with trailing spaces", ({
23+
assert,
24+
}) => {
25+
assert.snapshot(parse("[$ 1+1=2][. [link] ]", { hasTitle: false }));
26+
});
2027
});

test/line/formula.test.ts.snapshot

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
exports[`formula > Formula followed immediately by a decoration notation with trailing spaces 1`] = `
2+
[
3+
{
4+
"indent": 0,
5+
"type": "line",
6+
"nodes": [
7+
{
8+
"type": "formula",
9+
"raw": "[$ 1+1=2][. [link] ]",
10+
"formula": "1+1=2][. [link]"
11+
}
12+
]
13+
}
14+
]
15+
`;
16+
117
exports[`formula > Formula includes [] with tail half-space 1`] = `
218
[
319
{

0 commit comments

Comments
 (0)