Skip to content

Commit ac4adaf

Browse files
committed
Add tests
1 parent 299a621 commit ac4adaf

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

Tests/MarkdownUITests/MarkdownContentTests.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,4 +423,22 @@ final class MarkdownContentTests: XCTestCase {
423423
)
424424
XCTAssertEqual(markdown, content.renderMarkdown())
425425
}
426+
427+
func testComment() {
428+
// given
429+
let markdown = """
430+
<!--This is a comment-->
431+
<!--
432+
This is a
433+
multiline comment
434+
-->
435+
"""
436+
437+
// when
438+
let content = MarkdownContent(markdown)
439+
440+
// then
441+
XCTAssertEqual(MarkdownContent {}, content)
442+
XCTAssertEqual("", content.renderMarkdown())
443+
}
426444
}

Tests/MarkdownUITests/MarkdownTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,5 +342,21 @@
342342

343343
assertSnapshot(of: view, as: .image(layout: layout))
344344
}
345+
346+
func testComment() {
347+
let view = Markdown {
348+
#"""
349+
This is rendered
350+
<!--This is a comment-->
351+
<!--
352+
This is a multiline
353+
comment
354+
-->
355+
So is this
356+
"""#
357+
}.markdownSoftBreakMode(.lineBreak)
358+
359+
assertSnapshot(of: view, as: .image(layout: layout))
360+
}
345361
}
346362
#endif
52.1 KB
Loading

0 commit comments

Comments
 (0)