@@ -318,15 +318,15 @@ final class MacroToolkitTests: XCTestCase {
318
318
expandedSource: """
319
319
320
320
struct Point {
321
- var x: Int = 1 {
321
+ var x: Int {
322
322
get {
323
323
_storage[ " x " , default: 1] as! Int
324
324
}
325
325
set {
326
326
_storage[ " x " ] = newValue
327
327
}
328
328
}
329
- var y: Int = 2 {
329
+ var y: Int {
330
330
get {
331
331
_storage[ " y " , default: 2] as! Int
332
332
}
@@ -562,7 +562,7 @@ final class MacroToolkitTests: XCTestCase {
562
562
XCTAssertEqual ( n. initialValue? . _syntax. description, " [1, 2.5] " )
563
563
XCTAssertEqual ( n. isLazy, true )
564
564
}
565
-
565
+
566
566
func testAsyncInterfaceMacro( ) throws {
567
567
assertMacroExpansion (
568
568
"""
@@ -572,17 +572,17 @@ final class MacroToolkitTests: XCTestCase {
572
572
}
573
573
""" ,
574
574
expandedSource:
575
- """
576
- protocol API {
577
- func request(completion: (Int) -> Void)
578
-
579
- func request() async -> Int
580
- }
581
- """ ,
575
+ """
576
+ protocol API {
577
+ func request(completion: (Int) -> Void)
578
+
579
+ func request() async -> Int
580
+ }
581
+ """ ,
582
582
macros: testMacros
583
583
)
584
584
}
585
-
585
+
586
586
func testAsyncInterfaceAllMembersMacro( ) throws {
587
587
assertMacroExpansion (
588
588
"""
@@ -593,16 +593,16 @@ final class MacroToolkitTests: XCTestCase {
593
593
}
594
594
""" ,
595
595
expandedSource:
596
- """
597
- protocol API {
598
- func request1(completion: (Int) -> Void)
599
- func request2(completion: (String) -> Void)
600
-
601
- func request1() async -> Int
596
+ """
597
+ protocol API {
598
+ func request1(completion: (Int) -> Void)
599
+ func request2(completion: (String) -> Void)
602
600
603
- func request2() async -> String
604
- }
605
- """ ,
601
+ func request1() async -> Int
602
+
603
+ func request2() async -> String
604
+ }
605
+ """ ,
606
606
macros: testMacros
607
607
)
608
608
}
@@ -617,21 +617,21 @@ final class MacroToolkitTests: XCTestCase {
617
617
}
618
618
""" ,
619
619
expandedSource:
620
- """
621
- struct Client {
622
- func request1(completion: (Int) -> Void) {
623
- completion(0)
624
- }
625
-
626
- func request1() async -> Int {
627
- await withCheckedContinuation { continuation in
628
- request1() { returnValue in
629
- continuation.resume(returning: returnValue)
620
+ """
621
+ struct Client {
622
+ func request1(completion: (Int) -> Void) {
623
+ completion(0)
624
+ }
625
+
626
+ func request1() async -> Int {
627
+ await withCheckedContinuation { continuation in
628
+ request1() { returnValue in
629
+ continuation.resume(returning: returnValue)
630
+ }
630
631
}
631
632
}
632
633
}
633
- }
634
- """ ,
634
+ """ ,
635
635
macros: testMacros
636
636
)
637
637
}
@@ -649,32 +649,32 @@ final class MacroToolkitTests: XCTestCase {
649
649
}
650
650
""" ,
651
651
expandedSource:
652
- """
653
- struct Client {
654
- func request1(completion: (Int) -> Void) {
655
- completion(0)
656
- }
657
- func request2(completion: (String) -> Void) {
658
- completion( " " )
659
- }
660
-
661
- func request1() async -> Int {
662
- await withCheckedContinuation { continuation in
663
- request1() { returnValue in
664
- continuation.resume(returning: returnValue)
652
+ """
653
+ struct Client {
654
+ func request1(completion: (Int) -> Void) {
655
+ completion(0)
656
+ }
657
+ func request2(completion: (String) -> Void) {
658
+ completion( " " )
659
+ }
660
+
661
+ func request1() async -> Int {
662
+ await withCheckedContinuation { continuation in
663
+ request1() { returnValue in
664
+ continuation.resume(returning: returnValue)
665
+ }
665
666
}
666
667
}
667
- }
668
668
669
- func request2() async -> String {
670
- await withCheckedContinuation { continuation in
671
- request2() { returnValue in
672
- continuation.resume(returning: returnValue)
669
+ func request2() async -> String {
670
+ await withCheckedContinuation { continuation in
671
+ request2() { returnValue in
672
+ continuation.resume(returning: returnValue)
673
+ }
673
674
}
674
675
}
675
676
}
676
- }
677
- """ ,
677
+ """ ,
678
678
macros: testMacros
679
679
)
680
680
}
0 commit comments