Skip to content

Commit e4b6e26

Browse files
authored
(145226565) Fix ambiguity on macOS in PropertyListEncoderTests (#1183)
#1180 accidentally introduces a build issue on macOS due to new ambiguity between Foundation.String.Encoding and FoundationEssentials.String.Encoding but we weren't able to detect that since macOS CI is currently nonfunctional. This fixes the ambiguity using the same trick we use elsewhere in our unit tests. I've validated locally that this fixes the build issues on macOS.
1 parent 2c08d60 commit e4b6e26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/FoundationEssentialsTests/PropertyListEncoderTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,12 +1547,12 @@ data1 = <7465
15471547
}
15481548

15491549
func test_garbageCharactersAfterXMLTagName() throws {
1550-
let garbage = "<plist><dict><key>bar</key><stringGARBAGE>foo</string></dict></plist>".data(using: .utf8)!
1550+
let garbage = "<plist><dict><key>bar</key><stringGARBAGE>foo</string></dict></plist>".data(using: String._Encoding.utf8)!
15511551

15521552
XCTAssertThrowsError(try PropertyListDecoder().decode([String:String].self, from: garbage))
15531553

15541554
// Historical behavior allows for whitespace to immediately follow tag names
1555-
let acceptable = "<plist><dict><key>bar</key><string >foo</string></dict></plist>".data(using: .utf8)!
1555+
let acceptable = "<plist><dict><key>bar</key><string >foo</string></dict></plist>".data(using: String._Encoding.utf8)!
15561556

15571557
XCTAssertEqual(try PropertyListDecoder().decode([String:String].self, from: acceptable), ["bar":"foo"])
15581558
}

0 commit comments

Comments
 (0)