Skip to content

Commit b2f97b7

Browse files
committed
[Swift 6] Update Tests for Swift 6
1 parent e54ece6 commit b2f97b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+80
-0
lines changed

Tests/Tests/PlatformVersionTests.swift

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import XCTest
33

44
final class PlatformVersionTests: XCTestCase {
5+
@MainActor
56
func test_iOS_isCurrent() {
67
#if os(iOS)
78
if #available(iOS 17, *) {
@@ -44,6 +45,7 @@ final class PlatformVersionTests: XCTestCase {
4445
#endif
4546
}
4647

48+
@MainActor
4749
func test_iOS_isCurrentOrPast() {
4850
#if os(iOS)
4951
if #available(iOS 17, *) {
@@ -86,6 +88,7 @@ final class PlatformVersionTests: XCTestCase {
8688
#endif
8789
}
8890

91+
@MainActor
8992
func test_macOS_isCurrent() {
9093
#if os(macOS)
9194
if #available(macOS 14, *) {
@@ -128,6 +131,7 @@ final class PlatformVersionTests: XCTestCase {
128131
#endif
129132
}
130133

134+
@MainActor
131135
func test_macOS_isCurrentOrPast() {
132136
#if os(macOS)
133137
if #available(macOS 14, *) {
@@ -170,6 +174,7 @@ final class PlatformVersionTests: XCTestCase {
170174
#endif
171175
}
172176

177+
@MainActor
173178
func test_tvOS_isCurrent() {
174179
#if os(tvOS)
175180
if #available(tvOS 17, *) {
@@ -212,6 +217,7 @@ final class PlatformVersionTests: XCTestCase {
212217
#endif
213218
}
214219

220+
@MainActor
215221
func test_tvOS_isCurrentOrPast() {
216222
#if os(tvOS)
217223
if #available(tvOS 17, *) {

Tests/Tests/ViewTypes/ButtonTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class ButtonTests: XCTestCase {
88
typealias PlatformButton = NSButton
99
#endif
1010

11+
@MainActor
1112
func testButton() {
1213
XCTAssertViewIntrospection(of: PlatformButton.self) { spies in
1314
let spy0 = spies[0]

Tests/Tests/ViewTypes/ColorPickerTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ final class ColorPickerTests: XCTestCase {
1313
typealias PlatformColorPicker = NSColorWell
1414
#endif
1515

16+
@MainActor
1617
func testColorPicker() throws {
1718
guard #available(iOS 14, macOS 11, *) else {
1819
throw XCTSkip()

Tests/Tests/ViewTypes/DatePickerTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ final class DatePickerTests: XCTestCase {
1010
typealias PlatformDatePicker = NSDatePicker
1111
#endif
1212

13+
@MainActor
1314
func testDatePicker() {
1415
let date0 = Date(timeIntervalSince1970: 0)
1516
let date1 = Date(timeIntervalSince1970: 5)

Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ final class DatePickerWithCompactStyleTests: XCTestCase {
1111
typealias PlatformDatePickerWithCompactStyle = NSDatePicker
1212
#endif
1313

14+
@MainActor
1415
func testDatePickerWithCompactStyle() throws {
1516
guard #available(iOS 14, macOS 10.15.4, *) else {
1617
throw XCTSkip()

Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class DatePickerWithFieldStyleTests: XCTestCase {
88
typealias PlatformDatePickerWithFieldStyle = NSDatePicker
99
#endif
1010

11+
@MainActor
1112
func testDatePickerWithFieldStyle() {
1213
let date0 = Date(timeIntervalSince1970: 0)
1314
let date1 = Date(timeIntervalSince1970: 5)

Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ final class DatePickerWithGraphicalStyleTests: XCTestCase {
1111
typealias PlatformDatePickerWithGraphicalStyle = NSDatePicker
1212
#endif
1313

14+
@MainActor
1415
func testDatePickerWithGraphicalStyle() throws {
1516
guard #available(iOS 14, *) else {
1617
throw XCTSkip()

Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class DatePickerWithStepperFieldStyleTests: XCTestCase {
88
typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker
99
#endif
1010

11+
@MainActor
1112
func testDatePickerWithStepperFieldStyle() {
1213
let date0 = Date(timeIntervalSince1970: 0)
1314
let date1 = Date(timeIntervalSince1970: 5)

Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class DatePickerWithWheelStyleTests: XCTestCase {
88
typealias PlatformDatePickerWithWheelStyle = UIDatePicker
99
#endif
1010

11+
@MainActor
1112
func testDatePickerWithWheelStyle() {
1213
let date0 = Date(timeIntervalSince1970: 0)
1314
let date1 = Date(timeIntervalSince1970: 5)

Tests/Tests/ViewTypes/FormTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ final class FormTests: XCTestCase {
1010
typealias PlatformForm = NSScrollView
1111
#endif
1212

13+
@MainActor
1314
func testForm() throws {
1415
XCTAssertViewIntrospection(of: PlatformForm.self) { spies in
1516
let spy0 = spies[0]

Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ final class FormWithGroupedStyleTests: XCTestCase {
1010
typealias PlatformFormWithGroupedStyle = NSScrollView
1111
#endif
1212

13+
@MainActor
1314
func testFormWithGroupedStyle() throws {
1415
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
1516
throw XCTSkip()

Tests/Tests/ViewTypes/FullScreenCoverTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import XCTest
55

66
@available(iOS 14, tvOS 14, *)
77
final class FullScreenCoverTests: XCTestCase {
8+
9+
@MainActor
810
func testPresentationAsFullScreenCover() throws {
911
guard #available(iOS 14, tvOS 14, *) else {
1012
throw XCTSkip()

Tests/Tests/ViewTypes/ListCellTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ListCellTests: XCTestCase {
99
typealias PlatformListCell = NSTableCellView
1010
#endif
1111

12+
@MainActor
1213
func testListCell() {
1314
XCTAssertViewIntrospection(of: PlatformListCell.self) { spies in
1415
let spy = spies[0]
@@ -25,6 +26,7 @@ final class ListCellTests: XCTestCase {
2526
}
2627
}
2728

29+
@MainActor
2830
func testMaskedListCell() {
2931
XCTAssertViewIntrospection(of: PlatformListCell.self) { spies in
3032
let spy = spies[0]

Tests/Tests/ViewTypes/ListTests.swift

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ListTests: XCTestCase {
99
typealias PlatformList = NSTableView
1010
#endif
1111

12+
@MainActor
1213
func testList() {
1314
XCTAssertViewIntrospection(of: PlatformList.self) { spies in
1415
let spy0 = spies[0]
@@ -41,6 +42,7 @@ final class ListTests: XCTestCase {
4142
}
4243

4344
#if !os(macOS)
45+
@MainActor
4446
func testNestedList() {
4547
XCTAssertViewIntrospection(of: PlatformList.self) { spies in
4648
let spy0 = spies[0]
@@ -67,6 +69,7 @@ final class ListTests: XCTestCase {
6769
}
6870
#endif
6971

72+
@MainActor
7073
func testMaskedList() {
7174
XCTAssertViewIntrospection(of: PlatformList.self) { spies in
7275
let spy0 = spies[0]

Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ListWithBorderedStyleTests: XCTestCase {
99
typealias PlatformListWithBorderedStyle = NSTableView
1010
#endif
1111

12+
@MainActor
1213
func testListWithBorderedStyle() throws {
1314
guard #available(macOS 12, *) else {
1415
throw XCTSkip()

Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class ListWithGroupedStyleTests: XCTestCase {
88
typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView
99
#endif
1010

11+
@MainActor
1112
func testListWithGroupedStyle() {
1213
XCTAssertViewIntrospection(of: PlatformListWithGroupedStyle.self) { spies in
1314
let spy0 = spies[0]

Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ListWithInsetGroupedStyleTests: XCTestCase {
99
typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView
1010
#endif
1111

12+
@MainActor
1213
func testListWithInsetGroupedStyle() throws {
1314
guard #available(iOS 14, *) else {
1415
throw XCTSkip()

Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ final class ListWithInsetStyleTests: XCTestCase {
1111
typealias PlatformListWithInsetStyle = NSTableView
1212
#endif
1313

14+
@MainActor
1415
func testListWithInsetStyle() throws {
1516
guard #available(iOS 14, macOS 11, *) else {
1617
throw XCTSkip()

Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ListWithPlainStyleTests: XCTestCase {
99
typealias PlatformListWithPlainStyle = NSTableView
1010
#endif
1111

12+
@MainActor
1213
func testListWithPlainStyle() {
1314
XCTAssertViewIntrospection(of: PlatformListWithPlainStyle.self) { spies in
1415
let spy0 = spies[0]

Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ final class ListWithSidebarStyleTests: XCTestCase {
1111
typealias PlatformListWithSidebarStyle = NSTableView
1212
#endif
1313

14+
@MainActor
1415
func testListWithSidebarStyle() throws {
1516
guard #available(iOS 14, macOS 10.15, *) else {
1617
throw XCTSkip()

Tests/Tests/ViewTypes/MapTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import XCTest
88
final class MapTests: XCTestCase {
99
typealias PlatformMap = MKMapView
1010

11+
@MainActor
1112
func testMap() throws {
1213
guard #available(iOS 14, tvOS 14, macOS 11, *) else {
1314
throw XCTSkip()

Tests/Tests/ViewTypes/NavigationSplitViewTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ final class NavigationSplitViewTests: XCTestCase {
1212
typealias PlatformNavigationSplitView = NSSplitView
1313
#endif
1414

15+
@MainActor
1516
func testNavigationSplitView() throws {
1617
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
1718
throw XCTSkip()
@@ -41,6 +42,7 @@ final class NavigationSplitViewTests: XCTestCase {
4142
}
4243
}
4344

45+
@MainActor
4446
func testNavigationSplitViewAsAncestor() throws {
4547
guard #available(iOS 16, tvOS 16, macOS 13, *) else {
4648
throw XCTSkip()

Tests/Tests/ViewTypes/NavigationStackTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class NavigationStackTests: XCTestCase {
99
typealias PlatformNavigationStack = UINavigationController
1010
#endif
1111

12+
@MainActor
1213
func testNavigationStack() throws {
1314
guard #available(iOS 16, tvOS 16, *) else {
1415
throw XCTSkip()
@@ -29,6 +30,7 @@ final class NavigationStackTests: XCTestCase {
2930
}
3031
}
3132

33+
@MainActor
3234
func testNavigationStackAsAncestor() throws {
3335
guard #available(iOS 16, tvOS 16, *) else {
3436
throw XCTSkip()

Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ final class NavigationViewWithColumnsStyleTests: XCTestCase {
1111
typealias PlatformNavigationViewWithColumnsStyle = NSSplitView
1212
#endif
1313

14+
@MainActor
1415
func testNavigationViewWithColumnsStyle() {
1516
XCTAssertViewIntrospection(of: PlatformNavigationViewWithColumnsStyle.self) { spies in
1617
let spy = spies[0]
@@ -32,6 +33,7 @@ final class NavigationViewWithColumnsStyleTests: XCTestCase {
3233
}
3334
}
3435

36+
@MainActor
3537
func testNavigationViewWithColumnsStyleAsAncestor() {
3638
XCTAssertViewIntrospection(of: PlatformNavigationViewWithColumnsStyle.self) { spies in
3739
let spy = spies[0]

Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class NavigationViewWithStackStyleTests: XCTestCase {
88
typealias PlatformNavigationViewWithStackStyle = UINavigationController
99
#endif
1010

11+
@MainActor
1112
func testNavigationViewWithStackStyle() {
1213
XCTAssertViewIntrospection(of: PlatformNavigationViewWithStackStyle.self) { spies in
1314
let spy = spies[0]
@@ -25,6 +26,7 @@ final class NavigationViewWithStackStyleTests: XCTestCase {
2526
}
2627
}
2728

29+
@MainActor
2830
func testNavigationViewWithStackStyleAsAncestor() {
2931
XCTAssertViewIntrospection(of: PlatformNavigationViewWithStackStyle.self) { spies in
3032
let spy = spies[0]

Tests/Tests/ViewTypes/PageControlTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class PageControlTests: XCTestCase {
99
typealias PlatformPageControl = UIPageControl
1010
#endif
1111

12+
@MainActor
1213
func testPageControl() throws {
1314
guard #available(iOS 14, tvOS 14, *) else {
1415
throw XCTSkip()

Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class PickerWithMenuStyleTests: XCTestCase {
88
typealias PlatformPickerWithMenuStyle = NSPopUpButton
99
#endif
1010

11+
@MainActor
1112
func testPickerWithMenuStyle() {
1213
XCTAssertViewIntrospection(of: PlatformPickerWithMenuStyle.self) { spies in
1314
let spy0 = spies[0]

Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class PickerWithSegmentedStyleTests: XCTestCase {
99
typealias PlatformPickerWithSegmentedStyle = NSSegmentedControl
1010
#endif
1111

12+
@MainActor
1213
func testPickerWithSegmentedStyle() {
1314
XCTAssertViewIntrospection(of: PlatformPickerWithSegmentedStyle.self) { spies in
1415
let spy0 = spies[0]

Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class PickerWithWheelStyleTests: XCTestCase {
88
typealias PlatformPickerWithWheelStyle = UIPickerView
99
#endif
1010

11+
@MainActor
1112
func testPickerWithWheelStyle() {
1213
XCTAssertViewIntrospection(of: PlatformPickerWithWheelStyle.self) { spies in
1314
let spy0 = spies[0]

Tests/Tests/ViewTypes/PopoverTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import SwiftUIIntrospect
44
import XCTest
55

66
final class PopoverTests: XCTestCase {
7+
8+
@MainActor
79
func testPopover() throws {
810
XCTAssertViewIntrospection(of: UIPopoverPresentationController.self) { spies in
911
let spy0 = spies[0]

Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ProgressViewWithCircularStyleTests: XCTestCase {
99
typealias PlatformProgressViewWithCircularStyle = NSProgressIndicator
1010
#endif
1111

12+
@MainActor
1213
func testProgressViewWithCircularStyle() throws {
1314
guard #available(iOS 14, tvOS 14, macOS 11, *) else {
1415
throw XCTSkip()

Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ProgressViewWithLinearStyleTests: XCTestCase {
99
typealias PlatformProgressViewWithLinearStyle = NSProgressIndicator
1010
#endif
1111

12+
@MainActor
1213
func testProgressViewWithLinearStyle() throws {
1314
guard #available(iOS 14, tvOS 14, macOS 11, *) else {
1415
throw XCTSkip()

Tests/Tests/ViewTypes/ScrollViewTests.swift

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ScrollViewTests: XCTestCase {
99
typealias PlatformScrollView = NSScrollView
1010
#endif
1111

12+
@MainActor
1213
func testScrollView() {
1314
XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in
1415
let spy0 = spies[0]
@@ -49,6 +50,7 @@ final class ScrollViewTests: XCTestCase {
4950
}
5051
}
5152

53+
@MainActor
5254
func testNestedScrollView() {
5355
XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in
5456
let spy0 = spies[0]
@@ -87,6 +89,7 @@ final class ScrollViewTests: XCTestCase {
8789
}
8890
}
8991

92+
@MainActor
9093
func testMaskedScrollView() {
9194
XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in
9295
let spy0 = spies[0]

0 commit comments

Comments
 (0)