@@ -368,28 +368,6 @@ private struct MapTestView: View {
368
368
}
369
369
}
370
370
371
- #if swift(>=5.5) && !os(tvOS) // swift check needed for some reason for tvOS 14 testing not to fail on CI
372
- @available ( iOS 15 , * )
373
- @available ( tvOS, unavailable)
374
- private struct SearchControllerTestView : View {
375
- @State var searchText = " "
376
- let spy : ( ) -> Void
377
-
378
- var body : some View {
379
- NavigationView {
380
- EmptyView ( )
381
- . searchable ( text: $searchText)
382
- . introspectSearchController { searchController in
383
- self . spy ( )
384
- }
385
- }
386
- . introspectSplitViewController { splitViewController in
387
- splitViewController. preferredDisplayMode = . oneOverSecondary
388
- }
389
- }
390
- }
391
- #endif
392
-
393
371
class UIKitTests : XCTestCase {
394
372
func testNavigation( ) {
395
373
@@ -659,18 +637,36 @@ class UIKitTests: XCTestCase {
659
637
}
660
638
}
661
639
662
- #if swift(>=5.5) && !os(tvOS)
663
- @available ( iOS 15 , * )
640
+ @available ( tvOS, unavailable)
664
641
func testSearchController( ) {
665
- let expectation = XCTestExpectation ( )
666
- let view = SearchControllerTestView ( spy: {
667
- expectation. fulfill ( )
668
- } )
669
- TestUtils . present ( view: view)
670
- wait ( for: [ expectation] , timeout: TestUtils . Constants. timeout)
642
+ if #available( iOS 15 , * ) {
643
+ struct SearchControllerTestView : View {
644
+ @State var searchText = " "
645
+ let spy : ( ) -> Void
646
+
647
+ var body : some View {
648
+ NavigationView {
649
+ EmptyView ( )
650
+ . searchable ( text: $searchText)
651
+ . introspectSearchController { searchController in
652
+ self . spy ( )
653
+ }
654
+ }
655
+ . introspectSplitViewController { splitViewController in
656
+ splitViewController. preferredDisplayMode = . oneOverSecondary
657
+ }
658
+ }
659
+ }
660
+
661
+ let expectation = XCTestExpectation ( )
662
+ let view = SearchControllerTestView ( spy: {
663
+ expectation. fulfill ( )
664
+ } )
665
+ TestUtils . present ( view: view)
666
+ wait ( for: [ expectation] , timeout: TestUtils . Constants. timeout)
667
+ }
671
668
}
672
669
#endif
673
- #endif
674
670
675
671
@available ( iOS 14 , tvOS 14 , * )
676
672
func testMapView( ) {
0 commit comments