Skip to content

Commit

Permalink
revert async tag init
Browse files Browse the repository at this point in the history
  • Loading branch information
tib committed Feb 26, 2022
1 parent 885f0ca commit b2620a6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Sources/SwiftSgml/Tag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ open class Tag {
self.init(builder())
}

/// initialize a new Tag with children using an async throwing builder
public convenience init(@TagBuilder _ builder: () async throws -> [Tag]) async throws {
self.init(try await builder())
}
// /// initialize a new Tag with children using an async throwing builder
// public convenience init(@TagBuilder _ builder: () async throws -> [Tag]) async throws {
// self.init(try await builder())
// }


/// initialize a new Tag with some contents
Expand Down
38 changes: 19 additions & 19 deletions Tests/SwiftSgmlTests/TagTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@ final class TagTests: XCTestCase {
""")
}

func testConvenienceAsyncTagInit() async throws {

func leaf() async throws -> Leaf {
Leaf("hello")
}

let root = try await Root {
try await leaf()
}
let doc = Document {
root
}

XCTAssertEqual(DocumentRenderer().render(doc), """
<root>
<leaf>hello</leaf>
</root>
""")
}
// func testConvenienceAsyncTagInit() async throws {
//
// func leaf() async throws -> Leaf {
// Leaf("hello")
// }
//
// let root = try await Root {
// try await leaf()
// }
// let doc = Document {
// root
// }
//
// XCTAssertEqual(DocumentRenderer().render(doc), """
// <root>
// <leaf>hello</leaf>
// </root>
// """)
// }

}

0 comments on commit b2620a6

Please sign in to comment.