Skip to content

Commit 2853d7d

Browse files
committed
Fix everythindDocument
1 parent 9058e11 commit 2853d7d

File tree

4 files changed

+17
-49
lines changed

4 files changed

+17
-49
lines changed

[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ let package = Package(
4141
.testTarget(
4242
name: "MarkdownTests",
4343
dependencies: ["Markdown"],
44-
exclude: ["Visitors/Everything.md"]),
44+
resources: [.process("Visitors/Everything.md")]),
4545
.target(name: "CAtomic"),
4646
]
4747
)

Tests/MarkdownTests/Visitors/Everything.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
> BlockQuote
1414
1515
```swift
16-
func foo() { let x = 1 }
16+
func foo() {
17+
let x = 1
18+
}
1719
```
1820

21+
// Is this real code? Or just fantasy?
22+
1923
This is an <topic://autolink>.
2024

2125
---
2226

2327
<a href="foo.png">
24-
An HTML Block.
28+
An HTML Block.
2529
</a>
2630

2731
This is some <p>inline html</p>.

Tests/MarkdownTests/Visitors/MarkupRewriterTests.swift

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,7 @@ import XCTest
1212
@testable import Markdown
1313

1414
/// A `Document` that has every kind of element in it at least once.
15-
let everythingDocument = Document(parsing: """
16-
# Header
17-
18-
*Emphasized* **strong** `inline code` [link](foo) ![image](foo).
19-
20-
- this
21-
- is
22-
- a
23-
- list
24-
25-
1. eggs
26-
1. milk
27-
28-
> BlockQuote
29-
30-
```swift
31-
func foo() {
32-
let x = 1
33-
}
34-
```
35-
36-
// Is this real code? Or just fantasy?
37-
38-
This is an <topic://autolink>.
39-
40-
---
41-
42-
<a href="foo.png">
43-
An HTML Block.
44-
</a>
45-
46-
This is some <p>inline html</p>.
47-
48-
line
49-
break
50-
51-
soft
52-
break
53-
""")
15+
let everythingDocument = Document(parsing: try! String(contentsOf: Bundle.module.url(forResource: "Everything", withExtension: "md")!))
5416

5517

5618
class MarkupRewriterTests: XCTestCase {

Tests/MarkdownTests/Visitors/MarkupTreeDumperTests.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import XCTest
1414
final class MarkupTreeDumperTests: XCTestCase {
1515
func testDumpEverything() {
1616
let expectedDump = """
17-
Document @1:1-37:6 Root #\(everythingDocument.raw.metadata.id.rootId) #0
17+
Document @1:1-39:90 Root #\(everythingDocument.raw.metadata.id.rootId) #0
1818
├─ Heading @1:1-1:9 #1 level: 1
1919
│ └─ Text @1:3-1:9 #2 "Header"
2020
├─ Paragraph @3:1-3:65 #3
@@ -52,8 +52,8 @@ final class MarkupTreeDumperTests: XCTestCase {
5252
│ └─ ListItem @11:1-12:1 #35
5353
│ └─ Paragraph @11:4-11:8 #36
5454
│ └─ Text @11:4-11:8 #37 "milk"
55-
├─ BlockQuote @13:1-13:14 #38
56-
│ └─ Paragraph @13:3-13:14 #39
55+
├─ BlockQuote @13:1-13:13 #38
56+
│ └─ Paragraph @13:3-13:13 #39
5757
│ └─ Text @13:3-13:13 #40 "BlockQuote"
5858
├─ CodeBlock @15:1-19:4 #41 language: swift
5959
│ func foo() {
@@ -81,10 +81,12 @@ final class MarkupTreeDumperTests: XCTestCase {
8181
│ ├─ Text @33:1-33:7 #57 "line"
8282
│ ├─ LineBreak #58
8383
│ └─ Text @34:1-34:6 #59 "break"
84-
└─ Paragraph @36:1-37:6 #60
85-
├─ Text @36:1-36:5 #61 "soft"
86-
├─ SoftBreak #62
87-
└─ Text @37:1-37:6 #63 "break"
84+
├─ Paragraph @36:1-37:6 #60
85+
│ ├─ Text @36:1-36:5 #61 "soft"
86+
│ ├─ SoftBreak #62
87+
│ └─ Text @37:1-37:6 #63 "break"
88+
└─ HTMLBlock @39:1-39:90 #64
89+
<!-- Copyright (c) 2021 Apple Inc and the Swift Project authors. All Rights Reserved. -->
8890
"""
8991
print(everythingDocument.debugDescription(options: [.printEverything]))
9092
XCTAssertEqual(expectedDump, everythingDocument.debugDescription(options: [.printEverything]))

0 commit comments

Comments
 (0)