@@ -511,12 +511,14 @@ final class IssueTests: XCTestCase {
511
511
512
512
let randomNumber = Int . random ( in: 0 ... . max)
513
513
await Test {
514
+ #if !hasFeature(Embedded)
514
515
#expect {
515
516
asyncNotRequired ( )
516
517
throw MyError ( )
517
518
} throws: {
518
519
$0 is MyError
519
520
}
521
+ #endif
520
522
#expect( throws: MyError . self) {
521
523
asyncNotRequired ( )
522
524
throw MyError ( )
@@ -541,7 +543,11 @@ final class IssueTests: XCTestCase {
541
543
542
544
func testErrorCheckingWithExpect_Mismatching( ) async throws {
543
545
let expectationFailed = expectation ( description: " Expectation failed " )
546
+ #if !hasFeature(Embedded)
544
547
expectationFailed. expectedFulfillmentCount = 13
548
+ #else
549
+ expectationFailed. expectedFulfillmentCount = 10
550
+ #endif
545
551
546
552
var configuration = Configuration ( )
547
553
configuration. eventHandler = { event, _ in
@@ -559,11 +565,13 @@ final class IssueTests: XCTestCase {
559
565
let randomNumber = Int . random ( in: 0 ... . max)
560
566
561
567
await Test {
568
+ #if !hasFeature(Embedded)
562
569
#expect {
563
570
asyncNotRequired ( )
564
571
} throws: {
565
572
$0 is MyError
566
573
}
574
+ #endif
567
575
#expect( throws: MyError . self) {
568
576
asyncNotRequired ( )
569
577
}
@@ -582,11 +590,13 @@ final class IssueTests: XCTestCase {
582
590
#expect( throws: MyError ( ) ) {
583
591
throw MyDescriptiveError ( description: " something wrong " )
584
592
}
593
+ #if !hasFeature(Embedded)
585
594
#expect {
586
595
throw MyDescriptiveError ( description: " something wrong " )
587
596
} throws: {
588
597
_ in false
589
598
}
599
+ #endif
590
600
#expect( throws: Never . self) {
591
601
throw MyError ( )
592
602
}
@@ -600,12 +610,14 @@ final class IssueTests: XCTestCase {
600
610
#expect( throws: MyError . self) {
601
611
try nonVoidReturning ( )
602
612
}
613
+ #if !hasFeature(Embedded)
603
614
#expect {
604
615
throw MyError ( )
605
616
} throws: { error in
606
617
let parameterizedError = try #require( error as? MyParameterizedError )
607
618
return parameterizedError. index == 123
608
619
}
620
+ #endif
609
621
} . run ( configuration: configuration)
610
622
611
623
await fulfillment ( of: [ expectationFailed] , timeout: 0.0 )
@@ -681,11 +693,13 @@ final class IssueTests: XCTestCase {
681
693
682
694
let randomNumber = Int . random ( in: 0 ... . max)
683
695
await Test {
696
+ #if !hasFeature(Embedded)
684
697
await #expect { ( ) async throws in
685
698
throw MyError ( )
686
699
} throws: {
687
700
$0 is MyError
688
701
}
702
+ #endif
689
703
await #expect( throws: MyError . self) { ( ) async throws in
690
704
throw MyError ( )
691
705
}
@@ -708,7 +722,11 @@ final class IssueTests: XCTestCase {
708
722
709
723
func testErrorCheckingWithExpectAsync_Mismatching( ) async throws {
710
724
let expectationFailed = expectation ( description: " Expectation failed " )
725
+ #if !hasFeature(Embedded)
711
726
expectationFailed. expectedFulfillmentCount = 13
727
+ #else
728
+ expectationFailed. expectedFulfillmentCount = 10
729
+ #endif
712
730
713
731
var configuration = Configuration ( )
714
732
configuration. eventHandler = { event, _ in
@@ -724,9 +742,11 @@ final class IssueTests: XCTestCase {
724
742
725
743
let randomNumber = Int . random ( in: 0 ... . max)
726
744
await Test {
745
+ #if !hasFeature(Embedded)
727
746
await #expect { ( ) async in } throws: {
728
747
$0 is MyError
729
748
}
749
+ #endif
730
750
await #expect( throws: MyError . self) { ( ) async in }
731
751
await #expect( throws: MyParameterizedError ( index: randomNumber) ) { ( ) async in }
732
752
await #expect( throws: MyError . self) { ( ) async throws in
@@ -741,11 +761,13 @@ final class IssueTests: XCTestCase {
741
761
await #expect( throws: MyError ( ) ) { ( ) async throws in
742
762
throw MyDescriptiveError ( description: " something wrong " )
743
763
}
764
+ #if !hasFeature(Embedded)
744
765
await #expect { ( ) async throws in
745
766
throw MyDescriptiveError ( description: " something wrong " )
746
767
} throws: {
747
768
_ in false
748
769
}
770
+ #endif
749
771
await #expect( throws: Never . self) { ( ) async throws in
750
772
throw MyError ( )
751
773
}
@@ -759,12 +781,14 @@ final class IssueTests: XCTestCase {
759
781
await #expect( throws: MyError . self) {
760
782
try await nonVoidReturning ( )
761
783
}
784
+ #if !hasFeature(Embedded)
762
785
await #expect { ( ) async throws in
763
786
throw MyError ( )
764
787
} throws: { error in
765
788
let parameterizedError = try #require( error as? MyParameterizedError )
766
789
return parameterizedError. index == 123
767
790
}
791
+ #endif
768
792
} . run ( configuration: configuration)
769
793
770
794
await fulfillment ( of: [ expectationFailed] , timeout: 0.0 )
@@ -822,6 +846,7 @@ final class IssueTests: XCTestCase {
822
846
await fulfillment ( of: [ expectationFailed] , timeout: 0.0 )
823
847
}
824
848
849
+ #if !hasFeature(Embedded)
825
850
func testErrorCheckingWithExpect_ThrowingFromErrorMatcher( ) async throws {
826
851
let errorCaught = expectation ( description: " Error matcher's error caught " )
827
852
let expectationFailed = expectation ( description: " Expectation failed " )
@@ -931,6 +956,7 @@ final class IssueTests: XCTestCase {
931
956
932
957
await fulfillment ( of: [ errorCaught, expectationFailed] , timeout: 0.0 )
933
958
}
959
+ #endif
934
960
935
961
func testErrorCheckingWithExpect_ResultValue( ) throws {
936
962
let error = #expect( throws: MyDescriptiveError . self) {
0 commit comments