We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 213072d commit 3ca7a14Copy full SHA for 3ca7a14
Tests/SwiftSgmlTests/NodeTests.swift
@@ -0,0 +1,35 @@
1
+//
2
+// File.swift
3
4
5
+// Created by Tibor Bodecs on 2022. 02. 06..
6
7
+
8
+import XCTest
9
+@testable import SwiftSgml
10
11
+final class NodeTests: XCTestCase {
12
13
+ func testNodeContents() {
14
+ final class FooTag: Tag {
15
+ init(_ contents: String? = nil) {
16
+ super.init(Node(type: .standard, name: "foo", contents: contents))
17
+ }
18
19
+ func updateContents() -> Tag {
20
+ node.contents = "bar"
21
+ return self
22
23
24
25
26
+ let doc = Document {
27
+ FooTag()
28
+ .updateContents()
29
30
31
+ XCTAssertEqual(DocumentRenderer().render(doc), """
32
+ <foo>bar</foo>
33
+ """)
34
35
+}
0 commit comments