Skip to content

Commit 8facd3e

Browse files
authored
Test empty style prevention (#15)
* Update SwiftHtmlTests.swift
1 parent 2ce3194 commit 8facd3e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Tests/SwiftHtmlTests/SwiftHtmlTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ final class SwiftHtmlTests: XCTestCase {
112112
XCTAssertEqual(#"<span class="a c"></span>"#, html)
113113
}
114114

115+
func testSetEmptyStyle() {
116+
let doc = Document {
117+
Span("")
118+
.style("")
119+
}
120+
let html = DocumentRenderer(minify: true).render(doc)
121+
XCTAssertEqual(#"<span></span>"#, html)
122+
}
123+
115124
func testTextTag() {
116125
let doc = Document() {
117126
P {

0 commit comments

Comments
 (0)