Skip to content

Commit

Permalink
Fix testIntOrStringArrayRoundTrip()
Browse files Browse the repository at this point in the history
  • Loading branch information
bwetherfield authored and jsbean committed Jul 14, 2019
1 parent 53b2256 commit 70d82fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ struct XMLCoderElement: Equatable {
string += "</\(key)>"
}
} else if !elements.isEmpty {
string += prettyPrinted ? ">\n" : ">"
if !key.isEmpty {
string += prettyPrinted ? ">\n" : ">"
}
formatXMLElements(formatting, &string, level, cdata, prettyPrinted)

string += indentation
Expand All @@ -250,7 +252,7 @@ struct XMLCoderElement: Equatable {
extension XMLCoderElement {
init(key: String, box: UnkeyedBox) {
self.init(key: key, elements: box.map {
XMLCoderElement(key: key, box: $0)
XMLCoderElement(key: "", box: $0)
})
}

Expand Down

0 comments on commit 70d82fe

Please sign in to comment.