We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f720f3b commit c6dbb25Copy full SHA for c6dbb25
Tests/CodingTests/EncodingTests.swift
@@ -543,20 +543,28 @@ final class EncodingTests: XCTestCase {
543
544
@UsesEncoding(.lowercased)
545
var name: String = ""
546
+
547
+ @UsesEncoding(.arrayOf(.lowercased))
548
+ var hobbies: [String] = []
549
}
550
551
encoder.outputFormatting = .prettyPrinted
552
553
let user = User(
554
id: UUID(uuidString: "3B0B3AFC-4C61-4251-8FC5-F046D06DC3EC")!,
- name: "Joe Bloggs"
555
+ name: "Joe Bloggs",
556
+ hobbies: ["Poker", "Cycling"]
557
)
558
559
XCTAssertEqual(
560
"""
561
{
562
"id" : "3b0b3afc-4c61-4251-8fc5-f046d06dc3ec",
- "name" : "joe bloggs"
563
+ "name" : "joe bloggs",
564
+ "hobbies" : [
565
+ "poker",
566
+ "cycling"
567
+ ]
568
569
""",
570
stringValue(try encoder.encode(user))
0 commit comments