File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Tests/MarkdownTests/Parsing Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ This source file is part of the Swift.org open source project
3+
4+ Copyright (c) 2021 Apple Inc. and the Swift project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9+ */
10+
11+ @testable import Markdown
12+ import XCTest
13+
14+ class BacktickTests : XCTestCase {
15+ func testNormalBackticks( ) {
16+ let string = " Hello `test` String "
17+ let document = Document ( parsing: string)
18+ let expectedDump = """
19+ Document @1:1-1:20
20+ └─ Paragraph @1:1-1:20
21+ ├─ Text @1:1-1:7 " Hello "
22+ ├─ InlineCode @1:7-1:13 `test`
23+ └─ Text @1:13-1:20 " String "
24+ """
25+ XCTAssertEqual ( expectedDump, document. debugDescription ( options: . printSourceLocations) )
26+ }
27+
28+ func testOpenBacktick( ) {
29+ let single = " ` "
30+ let document = Document ( parsing: single)
31+ let expectedDump = """
32+ Document @1:1-1:2
33+ └─ Paragraph @1:1-1:2
34+ └─ Text @1:1-1:2 " ` "
35+ """
36+ XCTAssertEqual ( expectedDump, document. debugDescription ( options: . printSourceLocations) )
37+ }
38+
39+ func testOpenBackticks( ) {
40+ let double = " `` "
41+ let document = Document ( parsing: double)
42+ let expectedDump = """
43+ Document @1:1-1:3
44+ └─ Paragraph @1:1-1:3
45+ └─ Text @1:1-1:3 " `` "
46+ """
47+ XCTAssertEqual ( expectedDump, document. debugDescription ( options: . printSourceLocations) )
48+ }
49+ }
You can’t perform that action at this time.
0 commit comments