@@ -61,9 +61,7 @@ final class EncodingTests: XCTestCase {
61
61
stringValue (
62
62
try encoder. encode (
63
63
Value ( a: 123 , b: nil ) ,
64
- as: . combineWithKeys(
65
- Value . CodingKeys. self,
66
-
64
+ as: . combine(
67
65
Encoding < Int >
68
66
. withKey ( Value . CodingKeys. a)
69
67
. pullback ( \. a) ,
@@ -94,9 +92,7 @@ final class EncodingTests: XCTestCase {
94
92
stringValue (
95
93
try encoder. encode (
96
94
Value ( a: 123 , b: nil ) ,
97
- as: . combineWithKeys(
98
- Value . CodingKeys. self,
99
-
95
+ as: . combine(
100
96
Encoding < Int >
101
97
. withKey ( Value . CodingKeys. a)
102
98
. pullback ( \. a) ,
@@ -484,56 +480,6 @@ final class EncodingTests: XCTestCase {
484
480
)
485
481
}
486
482
487
- func testUnkeyedEncodingOfValueAttributes( ) {
488
- struct Value {
489
- var a : Int
490
- var b : String
491
- var c : Bool
492
- }
493
-
494
- let value = Value ( a: 1 , b: " A " , c: true )
495
-
496
- let encoding : Encoding < Value > = . combine(
497
- Encoding< Int> . singleValue. pullback ( \. a) ,
498
- Encoding< String> . singleValue. pullback ( \. b) ,
499
- Encoding< Bool> . singleValue. pullback ( \. c)
500
- )
501
-
502
- XCTAssertEqual (
503
- """
504
- [1, " A " ,true]
505
- """ ,
506
- stringValue ( try encoder. encode ( value, as: encoding) )
507
- )
508
- }
509
-
510
- func testEncodingOfValueAttributesAsArrayOfIndividualObjects( ) {
511
- struct Value {
512
- var a : Int
513
- var b : String
514
- var c : Bool
515
- }
516
-
517
- enum ValueKeys : CodingKey {
518
- case a, b, c
519
- }
520
-
521
- let value = Value ( a: 1 , b: " A " , c: true )
522
-
523
- let encoding : Encoding < Value > = . combine(
524
- Encoding < Int > . withKey ( ValueKeys . a) . pullback ( \. a) ,
525
- Encoding < String > . withKey ( ValueKeys . b) . pullback ( \. b) ,
526
- Encoding < Bool > . withKey ( ValueKeys . c) . pullback ( \. c)
527
- )
528
-
529
- XCTAssertEqual (
530
- """
531
- [{ " a " :1},{ " b " : " A " },{ " c " :true}]
532
- """ ,
533
- stringValue ( try encoder. encode ( value, as: encoding) )
534
- )
535
- }
536
-
537
483
// MARK: - Encoding Property Wrapper
538
484
539
485
func testEncodingPropertyWrapper( ) {
@@ -627,8 +573,8 @@ extension Encoding where Value == Manufacturer {
627
573
. withKey ( Model . CodingKeys. name)
628
574
. pullback ( \. name)
629
575
630
- static let `default` : Self = . combineWithKeys (
631
- Manufacturer . CodingKeys . self ,
576
+ static let `default` : Self = . combine (
577
+
632
578
name
633
579
)
634
580
}
@@ -642,8 +588,8 @@ extension Encoding where Value == Model {
642
588
. withKey ( Model . CodingKeys. engineSizes)
643
589
. pullback ( \. engineSizes)
644
590
645
- static let `default` : Self = . combineWithKeys (
646
- Model . CodingKeys. self,
591
+ static let `default` : Self = . combine (
592
+ // Model.CodingKeys.self,
647
593
name,
648
594
engineSizes
649
595
)
@@ -669,8 +615,8 @@ extension Encoding where Value == Car {
669
615
. withKey ( Car . CodingKeys. availableColors)
670
616
. pullback ( \. availableColors)
671
617
672
- static let `default` : Self = . combineWithKeys (
673
- Car . CodingKeys. self,
618
+ static let `default` : Self = . combine (
619
+ // Car.CodingKeys.self,
674
620
name,
675
621
model,
676
622
manufacturer,
0 commit comments