Skip to content

Commit c3bdf1c

Browse files
committed
wip
1 parent bce1641 commit c3bdf1c

File tree

2 files changed

+28
-32
lines changed

2 files changed

+28
-32
lines changed

IntrospectTests/UIKitTests.swift

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -368,28 +368,6 @@ private struct MapTestView: View {
368368
}
369369
}
370370

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-
393371
class UIKitTests: XCTestCase {
394372
func testNavigation() {
395373

@@ -659,18 +637,36 @@ class UIKitTests: XCTestCase {
659637
}
660638
}
661639

662-
#if swift(>=5.5) && !os(tvOS)
663-
@available(iOS 15, *)
640+
@available(tvOS, unavailable)
664641
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+
}
671668
}
672669
#endif
673-
#endif
674670

675671
@available(iOS 14, tvOS 14, *)
676672
func testMapView() {

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.4
1+
// swift-tools-version:5.5
22

33
import PackageDescription
44

0 commit comments

Comments
 (0)