File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -543,20 +543,28 @@ final class EncodingTests: XCTestCase {
543
543
544
544
@UsesEncoding ( . lowercased)
545
545
var name : String = " "
546
+
547
+ @UsesEncoding ( . arrayOf( . lowercased) )
548
+ var hobbies : [ String ] = [ ]
546
549
}
547
550
548
551
encoder. outputFormatting = . prettyPrinted
549
552
550
553
let user = User (
551
554
id: UUID ( uuidString: " 3B0B3AFC-4C61-4251-8FC5-F046D06DC3EC " ) !,
552
- name: " Joe Bloggs "
555
+ name: " Joe Bloggs " ,
556
+ hobbies: [ " Poker " , " Cycling " ]
553
557
)
554
558
555
559
XCTAssertEqual (
556
560
"""
557
561
{
558
562
" id " : " 3b0b3afc-4c61-4251-8fc5-f046d06dc3ec " ,
559
- " name " : " joe bloggs "
563
+ " name " : " joe bloggs " ,
564
+ " hobbies " : [
565
+ " poker " ,
566
+ " cycling "
567
+ ]
560
568
}
561
569
""" ,
562
570
stringValue ( try encoder. encode ( user) )
You can’t perform that action at this time.
0 commit comments