Skip to content

Commit 1d6b21f

Browse files
committed
Add test
1 parent 22fb43b commit 1d6b21f

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

src/transforms/__snapshots__/document.test.ts.snap

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,28 +166,30 @@ documentBody (4:2 ~ 9:2)
166166
</documentBody>
167167
`;
168168
169-
exports[`"...\\n\\n#\\n\\n" 1`] = `
170-
document (1:1 ~ 3:2)
169+
exports[`"...\\n\\n# comment 1\\n# comment 2\\n" 1`] = `
170+
document (1:1 ~ 4:12)
171171
1 | ...¶
172172
| ^^^^
173173
2 | ¶
174174
| ^
175-
3 | #¶
176-
| ^
177-
4 | ¶
175+
3 | #·comment·1¶
176+
| ^^^^^^^^^^^^
177+
4 | #·comment·2¶
178+
| ^^^^^^^^^^^
178179
5 | ¶
179180
<document documentEndMarker>
180181
<documentHead>
181182
182183
</documentHead>
183184
<documentBody>
184-
<endComment value="">
185+
<endComment value=" comment 1">
186+
<endComment value=" comment 2">
185187
</documentBody>
186188
</document>
187189
`;
188190
189-
exports[`"...\\n\\n#\\n\\n" 2`] = `
190-
documentBody (1:1 ~ 3:2)
191+
exports[`"...\\n\\n#\\n\\n" 1`] = `
192+
document (1:1 ~ 3:2)
191193
1 | ...¶
192194
| ^^^^
193195
2 | ¶
@@ -196,9 +198,14 @@ documentBody (1:1 ~ 3:2)
196198
| ^
197199
4 | ¶
198200
5 | ¶
199-
<documentBody>
200-
<endComment value="">
201-
</documentBody>
201+
<document documentEndMarker>
202+
<documentHead>
203+
204+
</documentHead>
205+
<documentBody>
206+
<endComment value="">
207+
</documentBody>
208+
</document>
202209
`;
203210
204211
exports[`"\\n" 1`] = `

src/transforms/document.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ testCases([
2222
["- AAA\n# comment\n---\n- BBB", selectors],
2323
["---\nhello\n... #documentEndComment\n", getDocument(0)],
2424
['&123 123 "123"\n\n... #123\n #\n\n123\n\n\n ', selectors],
25-
["...\n\n#\n\n", [getDocument(0), getDocumentBody(0)]],
25+
["...\n\n#\n\n", getDocument(0)],
2626
["#123\n#456\n---", getDocumentHead(0)],
27+
["...\n\n# comment 1\n# comment 2\n", getDocument(0)],
2728
["123\n--- #666\n456", root => root],
2829
["123\n...\n456", [getDocument(0), getDocumentBody(0)]],
2930
["", root => root],

0 commit comments

Comments
 (0)