From 3f03509f4f2e0e8b8e21970e2f76de9cfd70ce62 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:22:23 +0100 Subject: [PATCH 01/73] WIP --- Tests/Tests/TestUtils.swift | 224 ++++++++++++++++++++++++++---------- 1 file changed, 163 insertions(+), 61 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index 2cc8329a..a0ea619c 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -1,5 +1,5 @@ import SwiftUI -import XCTest +import Testing #if canImport(UIKit) @MainActor @@ -43,79 +43,181 @@ enum TestUtils { #endif @MainActor -func XCTAssertViewIntrospection( +@discardableResult +func introspection( of type: Entity.Type, - @ViewBuilder view: (Spies) -> some View, - extraAssertions: ([Entity]) -> Void = { _ in }, - file: StaticString = #file, - line: UInt = #line -) { - let spies = Spies() - let view = view(spies) - TestUtils.present(view: view) - XCTWaiter(delegate: spies).wait(for: spies.expectations.values.map(\.0), timeout: 3) - extraAssertions(spies.entities.sorted(by: { $0.key < $1.key }).map(\.value)) -} + @ViewBuilder view: ( + _ spy1: @escaping (Entity) -> Void, + ) -> some View, +) async throws -> Entity { + var entity1: Entity? + return try await confirmation(expectedCount: 1...) { confirmation1 in + let view = view( + { + confirmation1() + entity1 = $0 + }, + ) -final class Spies: NSObject, XCTWaiterDelegate { - private(set) var entities: [Int: Entity] = [:] - private(set) var expectations: [ObjectIdentifier: (XCTestExpectation, StaticString, UInt)] = [:] - - subscript( - number: Int, - file: StaticString = #file, - line: UInt = #line - ) -> (Entity) -> Void { - let expectation = XCTestExpectation() - expectations[ObjectIdentifier(expectation)] = (expectation, file, line) - return { [self] in - if let entity = entities[number] { - XCTAssert(entity === $0, "Found view was overriden by another view", file: file, line: line) - } - entities[number] = $0 - expectation.fulfill() + TestUtils.present(view: view) + + while entity1 == nil { + await Task.yield() } + + return try #require(entity1) } +} - func waiter( - _ waiter: XCTWaiter, - didTimeoutWithUnfulfilledExpectations unfulfilledExpectations: [XCTestExpectation] - ) { - for expectation in unfulfilledExpectations { - let (_, file, line) = expectations[ObjectIdentifier(expectation)]! - XCTFail("Spy not called", file: file, line: line) +@MainActor +@discardableResult +func introspection( + of type: Entity.Type, + @ViewBuilder view: ( + _ spy1: @escaping (Entity) -> Void, + _ spy2: @escaping (Entity) -> Void, + ) -> some View, +) async throws -> (Entity, Entity) { + var entity1: Entity? + var entity2: Entity? + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in + let view = view( + { + confirmation1() + entity1 = $0 + }, + { + confirmation2() + entity2 = $0 + }, + ) + + TestUtils.present(view: view) + + while + entity1 == nil || + entity2 == nil + { + await Task.yield() + } + + return try ( + #require(entity1), + #require(entity2), + ) } } +} - func nestedWaiter( - _ waiter: XCTWaiter, - wasInterruptedByTimedOutWaiter outerWaiter: XCTWaiter - ) { - XCTFail("wasInterruptedByTimedOutWaiter") - } +@MainActor +@discardableResult +func introspection( + of type: Entity.Type, + @ViewBuilder view: ( + _ spy1: @escaping (Entity) -> Void, + _ spy2: @escaping (Entity) -> Void, + _ spy3: @escaping (Entity) -> Void, + ) -> some View, +) async throws -> (Entity, Entity, Entity) { + var entity1: Entity? + var entity2: Entity? + var entity3: Entity? + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in + try await confirmation(expectedCount: 1...) { confirmation3 in + let view = view( + { + confirmation1() + entity1 = $0 + }, + { + confirmation2() + entity2 = $0 + }, + { + confirmation3() + entity3 = $0 + }, + ) - func waiter( - _ waiter: XCTWaiter, - fulfillmentDidViolateOrderingConstraintsFor expectation: XCTestExpectation, - requiredExpectation: XCTestExpectation - ) { - XCTFail("fulfillmentDidViolateOrderingConstraintsFor") - } + TestUtils.present(view: view) - func waiter( - _ waiter: XCTWaiter, - didFulfillInvertedExpectation expectation: XCTestExpectation - ) { - XCTFail("didFulfillInvertedExpectation") + while + entity1 == nil || + entity2 == nil || + entity3 == nil + { + await Task.yield() + } + + return try ( + #require(entity1), + #require(entity2), + #require(entity3), + ) + } + } } } -extension Collection { - subscript(safe index: Index, file: StaticString = #file, line: UInt = #line) -> Element? { - guard indices.contains(index) else { - XCTFail("Index \(index) is out of bounds", file: file, line: line) - return nil +@MainActor +@discardableResult +func introspection( + of type: Entity.Type, + @ViewBuilder view: ( + _ spy1: @escaping (Entity) -> Void, + _ spy2: @escaping (Entity) -> Void, + _ spy3: @escaping (Entity) -> Void, + _ spy4: @escaping (Entity) -> Void, + ) -> some View, +) async throws -> (Entity, Entity, Entity, Entity) { + var entity1: Entity? + var entity2: Entity? + var entity3: Entity? + var entity4: Entity? + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in + try await confirmation(expectedCount: 1...) { confirmation3 in + try await confirmation(expectedCount: 1...) { confirmation4 in + let view = view( + { + confirmation1() + entity1 = $0 + }, + { + confirmation2() + entity2 = $0 + }, + { + confirmation3() + entity3 = $0 + }, + { + confirmation4() + entity4 = $0 + }, + ) + + TestUtils.present(view: view) + + while + entity1 == nil || + entity2 == nil || + entity3 == nil || + entity4 == nil + { + await Task.yield() + } + + return try ( + #require(entity1), + #require(entity2), + #require(entity3), + #require(entity4), + ) + } + } } - return self[index] } } From 072d713853d2e734d0a29aa5088dcf41ae221771 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:22:42 +0100 Subject: [PATCH 02/73] WIP --- Tests/Tests/ViewTypes/ViewTests.swift | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Tests/Tests/ViewTypes/ViewTests.swift b/Tests/Tests/ViewTypes/ViewTests.swift index b5a475d1..12e425e6 100644 --- a/Tests/Tests/ViewTypes/ViewTests.swift +++ b/Tests/Tests/ViewTypes/ViewTests.swift @@ -1,34 +1,31 @@ import SwiftUI @testable import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ViewTests: XCTestCase { - func testView() { - XCTAssertViewIntrospection(of: PlatformView.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - +@Suite +struct ViewTests { + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformView.self) { spy1, spy2 in VStack(spacing: 10) { SUTView().frame(height: 30) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif SUTView().frame(height: 40) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.view, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.view, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif } .padding(10) - } extraAssertions: { - XCTAssertEqual($0[safe: 0]?.frame.height, 30) - XCTAssertEqual($0[safe: 1]?.frame.height, 40) } + #expect(entity1.frame.height == 30) + #expect(entity2.frame.height == 40) } } From 094013423251cc56e9e2fc8975c4f9735d65ea71 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:42:45 +0100 Subject: [PATCH 03/73] WIP --- Tests/Tests/ViewTypes/ColorPickerTests.swift | 49 ++++++++------------ 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/Tests/Tests/ViewTypes/ColorPickerTests.swift b/Tests/Tests/ViewTypes/ColorPickerTests.swift index 83abf809..c2da636c 100644 --- a/Tests/Tests/ViewTypes/ColorPickerTests.swift +++ b/Tests/Tests/ViewTypes/ColorPickerTests.swift @@ -1,11 +1,11 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, macOS 11, *) @MainActor -final class ColorPickerTests: XCTestCase { +@Suite +struct ColorPickerTests { #if canImport(UIKit) typealias PlatformColor = UIColor typealias PlatformColorPicker = UIColorWell @@ -14,49 +14,40 @@ final class ColorPickerTests: XCTestCase { typealias PlatformColorPicker = NSColorWell #endif - func testColorPicker() throws { - guard #available(iOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformColorPicker.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformColorPicker.self) { spy1, spy2, spy3 in VStack { ColorPicker("", selection: .constant(PlatformColor.red.cgColor)) #if os(iOS) || os(visionOS) - .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif ColorPicker("", selection: .constant(PlatformColor.green.cgColor)) #if os(iOS) || os(visionOS) - .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif ColorPicker("", selection: .constant(PlatformColor.blue.cgColor)) #if os(iOS) || os(visionOS) - .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.selectedColor, .red) - XCTAssertEqual($0[safe: 1]?.selectedColor, .green) - XCTAssertEqual($0[safe: 2]?.selectedColor, .blue) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.color, .red) - XCTAssertEqual($0[safe: 1]?.color, .green) - XCTAssertEqual($0[safe: 2]?.color, .blue) - #endif } + #if canImport(UIKit) + #expect(entity1.selectedColor == .red) + #expect(entity2.selectedColor == .green) + #expect(entity3.selectedColor == .blue) + #elseif canImport(AppKit) + #expect(entity1.color == .red) + #expect(entity2.color == .green) + #expect(entity3.color == .blue) + #endif } } #endif From 0ee75a3c53bae293a8ab9b4a0a2add60b69f5128 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:42:46 +0100 Subject: [PATCH 04/73] WIP --- .../NavigationViewWithStackStyleTests.swift | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 3d9de670..32d1d188 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -1,18 +1,17 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class NavigationViewWithStackStyleTests: XCTestCase { +@Suite +struct NavigationViewWithStackStyleTests { #if canImport(UIKit) typealias PlatformNavigationViewWithStackStyle = UINavigationController #endif - func testNavigationViewWithStackStyle() { - XCTAssertViewIntrospection(of: PlatformNavigationViewWithStackStyle.self) { spies in - let spy = spies[0] - + func testNavigationViewWithStackStyle() async throws { + try await introspection(of: PlatformNavigationViewWithStackStyle.self) { spy in NavigationView { ZStack { Color.red @@ -26,10 +25,8 @@ final class NavigationViewWithStackStyleTests: XCTestCase { } } - func testNavigationViewWithStackStyleAsAncestor() { - XCTAssertViewIntrospection(of: PlatformNavigationViewWithStackStyle.self) { spies in - let spy = spies[0] - + func testNavigationViewWithStackStyleAsAncestor() async throws { + try await introspection(of: PlatformNavigationViewWithStackStyle.self) { spy in NavigationView { ZStack { Color.red From c1aae4db1848325bdffdef9342ffcf44ee31d3ae Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:42:47 +0100 Subject: [PATCH 05/73] WIP --- Tests/Tests/ViewTypes/WindowTests.swift | 32 +++++++++++-------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Tests/Tests/ViewTypes/WindowTests.swift b/Tests/Tests/ViewTypes/WindowTests.swift index ebe8787f..7bb18c97 100644 --- a/Tests/Tests/ViewTypes/WindowTests.swift +++ b/Tests/Tests/ViewTypes/WindowTests.swift @@ -1,45 +1,41 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class WindowTests: XCTestCase { +@Suite +struct WindowTests { #if canImport(UIKit) typealias PlatformWindow = UIWindow #elseif canImport(AppKit) typealias PlatformWindow = NSWindow #endif - func testWindow() { - XCTAssertViewIntrospection(of: PlatformWindow.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformWindow.self) { spy1, spy2, spy3 in VStack { Image(systemName: "scribble") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Text("Text") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.window, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.window, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif - } extraAssertions: { - XCTAssertIdentical($0[safe: 0], $0[safe: 1]) - XCTAssertIdentical($0[safe: 0], $0[safe: 2]) - XCTAssertIdentical($0[safe: 1], $0[safe: 2]) } + #expect(entity1 === entity2) + #expect(entity1 === entity3) + #expect(entity2 === entity3) } } From 27c0374778a4707bfa3e6ae905c0d31fc4e47cfa Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:46:06 +0100 Subject: [PATCH 06/73] WIP --- Tests/Tests/ViewTypes/PopoverTests.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Tests/Tests/ViewTypes/PopoverTests.swift b/Tests/Tests/ViewTypes/PopoverTests.swift index 438fa719..d8af3704 100644 --- a/Tests/Tests/ViewTypes/PopoverTests.swift +++ b/Tests/Tests/ViewTypes/PopoverTests.swift @@ -1,21 +1,20 @@ #if !os(tvOS) && !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class PopoverTests: XCTestCase { - func testPopover() throws { - XCTAssertViewIntrospection(of: UIPopoverPresentationController.self) { spies in - let spy0 = spies[0] - +@Suite +struct PopoverTests { + @Test func introspect() async throws { + try await introspection(of: UIPopoverPresentationController.self) { spy in Text("Root") .popover(isPresented: .constant(true)) { Text("Popover") .introspect( .popover, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), - customize: spy0 + customize: spy ) } } From 6a1d6eaead59ee7db1eb978725b441c11961d002 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 17:46:07 +0100 Subject: [PATCH 07/73] WIP --- .../ProgressViewWithLinearStyleTests.swift | 48 ++++++++----------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift index ef66aaea..ce69a5e0 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift @@ -1,60 +1,52 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ProgressViewWithLinearStyleTests: XCTestCase { +@Suite +struct ProgressViewWithLinearStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithLinearStyle = UIProgressView #elseif canImport(AppKit) typealias PlatformProgressViewWithLinearStyle = NSProgressIndicator #endif - func testProgressViewWithLinearStyle() throws { - guard #available(iOS 14, tvOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformProgressViewWithLinearStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformProgressViewWithLinearStyle.self) { spy1, spy2, spy3 in VStack { ProgressView(value: 0.25) .progressViewStyle(.linear) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif ProgressView(value: 0.5) .progressViewStyle(.linear) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif ProgressView(value: 0.75) .progressViewStyle(.linear) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.progressView(style: .linear), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.progressView(style: .linear), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.progress, 0.25) - XCTAssertEqual($0[safe: 1]?.progress, 0.5) - XCTAssertEqual($0[safe: 2]?.progress, 0.75) - #elseif canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.doubleValue, 0.25) - XCTAssertEqual($0[safe: 1]?.doubleValue, 0.5) - XCTAssertEqual($0[safe: 2]?.doubleValue, 0.75) - #endif } + #if canImport(UIKit) + #expect(entity1.progress == 0.25) + #expect(entity2.progress == 0.5) + #expect(entity3.progress == 0.75) + #elseif canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.doubleValue == 0.25) + #expect(entity2.doubleValue == 0.5) + #expect(entity3.doubleValue == 0.75) + #endif } } From fc4ac79df2defb75e3205480f5bc53f750fd4d06 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:01:50 +0100 Subject: [PATCH 08/73] WIP --- .../TextFieldWithVerticalAxisTests.swift | 56 ++++++++----------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift index d03140d1..c8078d4f 100644 --- a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift @@ -1,10 +1,10 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 16, tvOS 16, macOS 13, *) @MainActor -final class TextFieldWithVerticalAxisTests: XCTestCase { +@Suite +struct TextFieldWithVerticalAxisTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformTextField = UITextView #elseif canImport(UIKit) && os(tvOS) @@ -13,56 +13,48 @@ final class TextFieldWithVerticalAxisTests: XCTestCase { typealias PlatformTextField = NSTextField #endif - func testTextFieldWithVerticalAxis() throws { - guard #available(iOS 16, tvOS 16, macOS 13, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTextField.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @available(iOS 16, tvOS 16, macOS 13, *) + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformTextField.self) { spy1, spy2, spy3 in VStack { TextField("", text: .constant("Text Field 1"), axis: .vertical) #if os(iOS) || os(visionOS) - .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(tvOS) - .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy0) + .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy0) + .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) TextField("", text: .constant("Text Field 2"), axis: .vertical) #if os(iOS) || os(visionOS) - .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(tvOS) - .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy1) + .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy2) #elseif os(macOS) - .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy1) + .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) TextField("", text: .constant("Text Field 3"), axis: .vertical) #if os(iOS) || os(visionOS) - .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.textField(axis: .vertical), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(tvOS) - .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy2) + .introspect(.textField(axis: .vertical), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy3) #elseif os(macOS) - .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy2) + .introspect(.textField(axis: .vertical), on: .macOS(.v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Text Field 1") - XCTAssertEqual($0[safe: 1]?.text, "Text Field 2") - XCTAssertEqual($0[safe: 2]?.text, "Text Field 3") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.stringValue, "Text Field 1") - XCTAssertEqual($0[safe: 1]?.stringValue, "Text Field 2") - XCTAssertEqual($0[safe: 2]?.stringValue, "Text Field 3") - #endif } + #if canImport(UIKit) + #expect(entity1.text == "Text Field 1") + #expect(entity2.text == "Text Field 2") + #expect(entity3.text == "Text Field 3") + #elseif canImport(AppKit) + #expect(entity1.stringValue == "Text Field 1") + #expect(entity2.stringValue == "Text Field 2") + #expect(entity3.stringValue == "Text Field 3") + #endif } } From 483d7cf84449e797ef3de3b5ea773d1d60f26110 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:01:52 +0100 Subject: [PATCH 09/73] WIP --- Tests/Tests/ViewTypes/SliderTests.swift | 44 +++++++++++-------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/Tests/Tests/ViewTypes/SliderTests.swift b/Tests/Tests/ViewTypes/SliderTests.swift index 64371431..7d12e6e2 100644 --- a/Tests/Tests/ViewTypes/SliderTests.swift +++ b/Tests/Tests/ViewTypes/SliderTests.swift @@ -1,57 +1,53 @@ #if !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class SliderTests: XCTestCase { +@Suite +struct SliderTests { #if canImport(UIKit) typealias PlatformSlider = UISlider #elseif canImport(AppKit) typealias PlatformSlider = NSSlider #endif - func testSlider() { - XCTAssertViewIntrospection(of: PlatformSlider.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformSlider.self) { spy1, spy2, spy3 in VStack { Slider(value: .constant(0.2), in: 0...1) #if os(iOS) - .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy0) + .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) Slider(value: .constant(0.5), in: 0...1) #if os(iOS) - .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) #elseif os(macOS) - .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) Slider(value: .constant(0.8), in: 0...1) #if os(iOS) - .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) + .introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy3) #elseif os(macOS) - .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.slider, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.value, 0.2) - XCTAssertEqual($0[safe: 1]?.value, 0.5) - XCTAssertEqual($0[safe: 2]?.value, 0.8) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.floatValue, 0.2) - XCTAssertEqual($0[safe: 1]?.floatValue, 0.5) - XCTAssertEqual($0[safe: 2]?.floatValue, 0.8) - #endif } + #if canImport(UIKit) + #expect(entity1.value == 0.2) + #expect(entity2.value == 0.5) + #expect(entity3.value == 0.8) + #elseif canImport(AppKit) + #expect(entity1.floatValue == 0.2) + #expect(entity2.floatValue == 0.5) + #expect(entity3.floatValue == 0.8) + #endif } } #endif From f27d47c220de2a95b70fed47271eaca516f9b292 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:33:19 +0100 Subject: [PATCH 10/73] WIP --- Tests/Tests/ViewTypes/FormTests.swift | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Tests/Tests/ViewTypes/FormTests.swift b/Tests/Tests/ViewTypes/FormTests.swift index 35f021eb..866b1110 100644 --- a/Tests/Tests/ViewTypes/FormTests.swift +++ b/Tests/Tests/ViewTypes/FormTests.swift @@ -1,41 +1,38 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class FormTests: XCTestCase { +@Suite +struct FormTests { #if canImport(UIKit) typealias PlatformForm = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformForm = NSScrollView #endif - func testForm() throws { - XCTAssertViewIntrospection(of: PlatformForm.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformForm.self) { spy1, spy2 in HStack { Form { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.form, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.form, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.form, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.form, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif Form { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.form, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } - .introspect(.form, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.form, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) + .introspect(.form, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #endif } } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From 3dc148a23382fb926db767c542c1404e75fbf5a4 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:33:20 +0100 Subject: [PATCH 11/73] WIP --- Tests/Tests/ViewTypes/StepperTests.swift | 28 ++++++++++-------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Tests/Tests/ViewTypes/StepperTests.swift b/Tests/Tests/ViewTypes/StepperTests.swift index 70f2d917..ee3a89c8 100644 --- a/Tests/Tests/ViewTypes/StepperTests.swift +++ b/Tests/Tests/ViewTypes/StepperTests.swift @@ -1,49 +1,45 @@ #if !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class StepperTests: XCTestCase { +@Suite +struct StepperTests { #if canImport(UIKit) typealias PlatformStepper = UIStepper #elseif canImport(AppKit) typealias PlatformStepper = NSStepper #endif - func testStepper() { - XCTAssertViewIntrospection(of: PlatformStepper.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformStepper.self) { spy1, spy2, spy3 in VStack { Stepper("", value: .constant(0), in: 0...10) #if os(iOS) - .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy0) + .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) Stepper("", value: .constant(0), in: 0...10) #if os(iOS) - .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) #elseif os(macOS) - .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) Stepper("", value: .constant(0), in: 0...10) #if os(iOS) - .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) + .introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy3) #elseif os(macOS) - .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.stepper, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - XCTAssert(Set($0.map(ObjectIdentifier.init)).count == 3) } + #expect(Set([entity1, entity2, entity3].map(ObjectIdentifier.init)).count == 3) } } #endif From 6acc32a1fcef0f50c3ba03561b16895644cd8098 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:33:22 +0100 Subject: [PATCH 12/73] WIP --- Tests/Tests/ViewTypes/ToggleTests.swift | 44 +++++++++++-------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/Tests/Tests/ViewTypes/ToggleTests.swift b/Tests/Tests/ViewTypes/ToggleTests.swift index cd122502..c27dd0ca 100644 --- a/Tests/Tests/ViewTypes/ToggleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleTests.swift @@ -1,55 +1,51 @@ #if !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ToggleTests: XCTestCase { +@Suite +struct ToggleTests { #if canImport(UIKit) typealias PlatformToggle = UISwitch #elseif canImport(AppKit) typealias PlatformToggle = NSButton #endif - func testToggle() { - XCTAssertViewIntrospection(of: PlatformToggle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformToggle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) #if os(iOS) - .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy0) + .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Toggle("", isOn: .constant(false)) #if os(iOS) - .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) #elseif os(macOS) - .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif Toggle("", isOn: .constant(true)) #if os(iOS) - .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) + .introspect(.toggle, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy3) #elseif os(macOS) - .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.toggle, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.isOn, true) - XCTAssertEqual($0[safe: 1]?.isOn, false) - XCTAssertEqual($0[safe: 2]?.isOn, true) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.state, .on) - XCTAssertEqual($0[safe: 1]?.state, .off) - XCTAssertEqual($0[safe: 2]?.state, .on) - #endif } + #if canImport(UIKit) + #expect(entity1.isOn == true) + #expect(entity2.isOn == false) + #expect(entity3.isOn == true) + #elseif canImport(AppKit) + #expect(entity1.state == .on) + #expect(entity2.state == .off) + #expect(entity3.state == .on) + #endif } } #endif From e1b81ca9ff636ca9b0ac685f5893723025eeaec7 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:33:23 +0100 Subject: [PATCH 13/73] WIP --- Tests/Tests/ViewTypes/WebViewTests.swift | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Tests/Tests/ViewTypes/WebViewTests.swift b/Tests/Tests/ViewTypes/WebViewTests.swift index 98b02785..dc7a1127 100644 --- a/Tests/Tests/ViewTypes/WebViewTests.swift +++ b/Tests/Tests/ViewTypes/WebViewTests.swift @@ -8,39 +8,34 @@ import WebKit @Suite struct WebViewTests { @available(iOS 26, tvOS 26, macOS 26, visionOS 26, *) - @Test func webView() async throws { - XCTAssertViewIntrospection(of: WKWebView.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: WKWebView.self) { spy1, spy2, spy3 in VStack { WebView(url: nil) .introspect( .webView, on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26), - customize: spy0 + customize: spy1 ) WebView(url: nil) .introspect( .webView, on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26), - customize: spy1 + customize: spy2 ) WebView(url: nil) .introspect( .webView, on: .iOS(.v26), .tvOS(.v26), .macOS(.v26), .visionOS(.v26), - customize: spy2 + customize: spy3 ) } - } extraAssertions: { - #expect($0[safe: 0] !== $0[safe: 1]) - #expect($0[safe: 0] !== $0[safe: 2]) - #expect($0[safe: 1] !== $0[safe: 2]) } + #expect(entity1 !== entity2) + #expect(entity1 !== entity3) + #expect(entity2 !== entity3) } } #endif From c45a2b12dc665d61db4b2d94c40b329a2466f6d2 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:35:16 +0100 Subject: [PATCH 14/73] WIP --- Tests/Tests/ViewTypes/MapTests.swift | 30 ++++++++++------------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/Tests/Tests/ViewTypes/MapTests.swift b/Tests/Tests/ViewTypes/MapTests.swift index 0e5aceef..9958a550 100644 --- a/Tests/Tests/ViewTypes/MapTests.swift +++ b/Tests/Tests/ViewTypes/MapTests.swift @@ -2,23 +2,14 @@ import MapKit import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, tvOS 14, macOS 11, *) @MainActor -final class MapTests: XCTestCase { +@Suite struct MapTests { typealias PlatformMap = MKMapView - func testMap() throws { - guard #available(iOS 14, tvOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformMap.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformMap.self) { spy1, spy2, spy3 in let region = Binding.constant(MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), span: MKCoordinateSpan(latitudeDelta: 0.5, longitudeDelta: 0.5))) VStack { @@ -26,28 +17,27 @@ final class MapTests: XCTestCase { .introspect( .map, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .macOS(.v11, .v12, .v13, .v14, .v15, .v26), .visionOS(.v1, .v2, .v26), - customize: spy0 + customize: spy1 ) Map(coordinateRegion: region) .introspect( .map, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .macOS(.v11, .v12, .v13, .v14, .v15, .v26), .visionOS(.v1, .v2, .v26), - customize: spy1 + customize: spy2 ) Map(coordinateRegion: region) .introspect( .map, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .macOS(.v11, .v12, .v13, .v14, .v15, .v26), .visionOS(.v1, .v2, .v26), - customize: spy2 + customize: spy3 ) } - } extraAssertions: { - XCTAssertNotIdentical($0[safe: 0], $0[safe: 1]) - XCTAssertNotIdentical($0[safe: 0], $0[safe: 2]) - XCTAssertNotIdentical($0[safe: 1], $0[safe: 2]) } + #expect(entity1 !== entity2) + #expect(entity1 !== entity3) + #expect(entity2 !== entity3) } } #endif From e0e8ec3a0d81adc15a6dc25120c62e4988ccaf41 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:36:46 +0100 Subject: [PATCH 15/73] WIP --- .../PickerWithSegmentedStyleTests.swift | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift index 5f85aac5..c30fb140 100644 --- a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift @@ -1,30 +1,27 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class PickerWithSegmentedStyleTests: XCTestCase { +@Suite +struct PickerWithSegmentedStyleTests { #if canImport(UIKit) typealias PlatformPickerWithSegmentedStyle = UISegmentedControl #elseif canImport(AppKit) typealias PlatformPickerWithSegmentedStyle = NSSegmentedControl #endif - func testPickerWithSegmentedStyle() { - XCTAssertViewIntrospection(of: PlatformPickerWithSegmentedStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformPickerWithSegmentedStyle.self) { spy1, spy2, spy3 in VStack { Picker("Pick", selection: .constant("1")) { Text("1").tag("1") } .pickerStyle(.segmented) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) @@ -34,9 +31,9 @@ final class PickerWithSegmentedStyleTests: XCTestCase { } .pickerStyle(.segmented) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) @@ -47,21 +44,20 @@ final class PickerWithSegmentedStyleTests: XCTestCase { } .pickerStyle(.segmented) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.picker(style: .segmented), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.picker(style: .segmented), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.numberOfSegments, 1) - XCTAssertEqual($0[safe: 1]?.numberOfSegments, 2) - XCTAssertEqual($0[safe: 2]?.numberOfSegments, 3) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.segmentCount, 1) - XCTAssertEqual($0[safe: 1]?.segmentCount, 2) - XCTAssertEqual($0[safe: 2]?.segmentCount, 3) - #endif } + #if canImport(UIKit) + #expect(entity1.numberOfSegments == 1) + #expect(entity2.numberOfSegments == 2) + #expect(entity3.numberOfSegments == 3) + #elseif canImport(AppKit) + #expect(entity1.segmentCount == 1) + #expect(entity2.segmentCount == 2) + #expect(entity3.segmentCount == 3) + #endif } } From 0ad20eaac640d90f1cc72fbbde762fec53d190b5 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:38:15 +0100 Subject: [PATCH 16/73] WIP --- .../ViewTypes/ListWithSidebarStyleTests.swift | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift index a60bd6f0..754cef04 100644 --- a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift @@ -1,52 +1,44 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, macOS 10.15, *) @MainActor -final class ListWithSidebarStyleTests: XCTestCase { +@Suite +struct ListWithSidebarStyleTests { #if canImport(UIKit) typealias PlatformListWithSidebarStyle = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformListWithSidebarStyle = NSTableView #endif - func testListWithSidebarStyle() throws { - guard #available(iOS 14, macOS 10.15, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformListWithSidebarStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithSidebarStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.sidebar) #if os(iOS) || os(visionOS) - .introspect(.list(style: .sidebar), on: .iOS(.v14, .v15)) { spy0($0) } - .introspect(.list(style: .sidebar), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list(style: .sidebar), on: .iOS(.v14, .v15), customize: spy1) + .introspect(.list(style: .sidebar), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.list(style: .sidebar), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list(style: .sidebar), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(visionOS) - .introspect(.list(style: .sidebar), on: .iOS(.v14, .v15), scope: .ancestor) { spy1($0) } - .introspect(.list(style: .sidebar), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .sidebar), on: .iOS(.v14, .v15), scope: .ancestor, customize: spy2) + .introspect(.list(style: .sidebar), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.list(style: .sidebar), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .sidebar), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.sidebar) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From 13d01dd014cdd56ede8c80d30654b1855ecc70b5 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:40:35 +0100 Subject: [PATCH 17/73] WIP --- Tests/Tests/ViewTypes/PageControlTests.swift | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Tests/Tests/ViewTypes/PageControlTests.swift b/Tests/Tests/ViewTypes/PageControlTests.swift index 9564e6af..848df2ae 100644 --- a/Tests/Tests/ViewTypes/PageControlTests.swift +++ b/Tests/Tests/ViewTypes/PageControlTests.swift @@ -1,23 +1,17 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, tvOS 14, *) @MainActor -final class PageControlTests: XCTestCase { +@Suite +struct PageControlTests { #if canImport(UIKit) typealias PlatformPageControl = UIPageControl #endif - func testPageControl() throws { - guard #available(iOS 14, tvOS 14, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformPageControl.self) { spies in - let spy = spies[0] - + @Test func introspect() async throws { + try await introspection(of: PlatformPageControl.self) { spy in TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) From 8f940877d47857c1c64e6008abda7cf4a0910c38 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:40:36 +0100 Subject: [PATCH 18/73] WIP --- Tests/Tests/ViewTypes/TextEditorTests.swift | 49 +++++++++------------ 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/Tests/Tests/ViewTypes/TextEditorTests.swift b/Tests/Tests/ViewTypes/TextEditorTests.swift index 890124db..8c32a347 100644 --- a/Tests/Tests/ViewTypes/TextEditorTests.swift +++ b/Tests/Tests/ViewTypes/TextEditorTests.swift @@ -1,62 +1,53 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, macOS 11, *) @MainActor -final class TextEditorTests: XCTestCase { +@Suite +struct TextEditorTests { #if canImport(UIKit) typealias PlatformTextEditor = UITextView #elseif canImport(AppKit) typealias PlatformTextEditor = NSTextView #endif - func testTextEditor() throws { - guard #available(iOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTextEditor.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformTextEditor.self) { spy1, spy2, spy3 in VStack { TextEditor(text: .constant("Text Field 0")) #if os(iOS) || os(visionOS) - .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) TextEditor(text: .constant("Text Field 1")) #if os(iOS) || os(visionOS) - .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) TextEditor(text: .constant("Text Field 2")) #if os(iOS) || os(visionOS) - .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.textEditor, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.textEditor, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.text, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.text, "Text Field 2") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.string, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.string, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.string, "Text Field 2") - #endif } + #if canImport(UIKit) + #expect(entity1.text == "Text Field 0") + #expect(entity2.text == "Text Field 1") + #expect(entity3.text == "Text Field 2") + #elseif canImport(AppKit) + #expect(entity1.string == "Text Field 0") + #expect(entity2.string == "Text Field 1") + #expect(entity3.string == "Text Field 2") + #endif } } #endif From 8cd127fe3ee9e89ba7eaa3db2a1cb27c76dcdc42 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:43:02 +0100 Subject: [PATCH 19/73] WIP --- .../NavigationViewWithColumnsStyleTests.swift | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift index 22ebd547..8cb78860 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift @@ -1,9 +1,10 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class NavigationViewWithColumnsStyleTests: XCTestCase { +@Suite +struct NavigationViewWithColumnsStyleTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationViewWithColumnsStyle = UISplitViewController #elseif canImport(UIKit) && os(tvOS) @@ -12,10 +13,8 @@ final class NavigationViewWithColumnsStyleTests: XCTestCase { typealias PlatformNavigationViewWithColumnsStyle = NSSplitView #endif - func testNavigationViewWithColumnsStyle() { - XCTAssertViewIntrospection(of: PlatformNavigationViewWithColumnsStyle.self) { spies in - let spy = spies[0] - + @Test func introspect() async throws { + try await introspection(of: PlatformNavigationViewWithColumnsStyle.self) { spy in NavigationView { ZStack { Color.red @@ -33,10 +32,8 @@ final class NavigationViewWithColumnsStyleTests: XCTestCase { } } - func testNavigationViewWithColumnsStyleAsAncestor() { - XCTAssertViewIntrospection(of: PlatformNavigationViewWithColumnsStyle.self) { spies in - let spy = spies[0] - + @Test func introspectAsAncestor() async throws { + try await introspection(of: PlatformNavigationViewWithColumnsStyle.self) { spy in NavigationView { ZStack { Color.red From 3d83df1c828d33b58ecabe5fe82623d5c05a5308 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:46:33 +0100 Subject: [PATCH 20/73] WIP --- Tests/Tests/ViewTypes/SheetTests.swift | 42 ++++++++++---------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/Tests/Tests/ViewTypes/SheetTests.swift b/Tests/Tests/ViewTypes/SheetTests.swift index e849bcef..0cae40a6 100644 --- a/Tests/Tests/ViewTypes/SheetTests.swift +++ b/Tests/Tests/ViewTypes/SheetTests.swift @@ -1,74 +1,64 @@ #if !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class SheetTests: XCTestCase { +@Suite +struct SheetTests { #if os(iOS) - func testSheet() throws { - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in - let spy0 = spies[0] - + @Test func introspect() async throws { + try await introspection(of: UIPresentationController.self) { spy in Text("Root") .sheet(isPresented: .constant(true)) { Text("Sheet") .introspect( .sheet, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), - customize: spy0 + customize: spy ) } } } - func testSheetAsSheetPresentationController() throws { - guard #available(iOS 15, tvOS 15, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: UISheetPresentationController.self) { spies in - let spy0 = spies[0] - + @available(iOS 15, tvOS 15, *) + @Test func introspectAsSheetPresentationController() async throws { + try await introspection(of: UISheetPresentationController.self) { spy in Text("Root") .sheet(isPresented: .constant(true)) { Text("Sheet") .introspect( .sheet, on: .iOS(.v15, .v16, .v17, .v18, .v26), - customize: spy0 + customize: spy ) } } } #elseif os(tvOS) - func testSheet() throws { - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in - let spy0 = spies[0] - + @Test func introspect() async throws { + try await introspection(of: UIPresentationController.self) { spy in Text("Root") .sheet(isPresented: .constant(true)) { Text("Content") .introspect( .sheet, on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), - customize: spy0 + customize: spy ) } } } #elseif os(visionOS) - func testSheet() throws { - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in - let spy0 = spies[0] - + @Test func introspect() async throws { + try await introspection(of: UIPresentationController.self) { spy in Text("Root") .sheet(isPresented: .constant(true)) { Text("Sheet") .introspect( .sheet, on: .visionOS(.v1, .v2, .v26), - customize: spy0 + customize: spy ) } } From c75508a0b0d80f379467c42b7a99ea056c87ee98 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:55:56 +0100 Subject: [PATCH 21/73] WIP --- .../ViewTypes/TabViewWithPageStyleTests.swift | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift index d012b30a..e63bdf11 100644 --- a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift +++ b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift @@ -1,23 +1,17 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, tvOS 14, *) @MainActor -final class TabViewWithPageStyleTests: XCTestCase { +@Suite +struct TabViewWithPageStyleTests { #if canImport(UIKit) typealias PlatformTabViewWithPageStyle = UICollectionView #endif - func testTabViewWithPageStyle() throws { - guard #available(iOS 14, tvOS 14, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTabViewWithPageStyle.self) { spies in - let spy = spies[0] - + @Test func introspect() async throws { + try await introspection(of: PlatformTabViewWithPageStyle.self) { spy in TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) Text("Page 2").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.blue) @@ -29,14 +23,8 @@ final class TabViewWithPageStyleTests: XCTestCase { } } - func testTabViewWithPageStyleAsAncestor() throws { - guard #available(iOS 14, tvOS 14, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTabViewWithPageStyle.self) { spies in - let spy = spies[0] - + @Test func introspectAsAncestor() async throws { + try await introspection(of: PlatformTabViewWithPageStyle.self) { spy in TabView { Text("Page 1").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) #if os(iOS) || os(tvOS) || os(visionOS) From d5ef70546ca73d2026accd44aeef57354bc65915 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 18:57:54 +0100 Subject: [PATCH 22/73] WIP --- .../DatePickerWithWheelStyleTests.swift | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index 1294d80f..30c4e524 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -1,52 +1,48 @@ #if !os(tvOS) && !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class DatePickerWithWheelStyleTests: XCTestCase { +@Suite +struct DatePickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithWheelStyle = UIDatePicker #endif - func testDatePickerWithWheelStyle() { - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 5) - let date2 = Date(timeIntervalSince1970: 10) - - XCTAssertViewIntrospection(of: PlatformDatePickerWithWheelStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 5) + let date3 = Date(timeIntervalSince1970: 10) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePickerWithWheelStyle.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) + DatePicker("", selection: .constant(date1)) .datePickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date1)) + DatePicker("", selection: .constant(date2)) .datePickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date2)) + DatePicker("", selection: .constant(date3)) .datePickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.datePicker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.date, date0) - XCTAssertEqual($0[safe: 1]?.date, date1) - XCTAssertEqual($0[safe: 2]?.date, date2) - #endif } + #if canImport(UIKit) + #expect(entity1.date == date1) + #expect(entity2.date == date2) + #expect(entity3.date == date3) + #endif } } #endif From e399b571fc8b790fc9407cc34224d3071ee03961 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:00:32 +0100 Subject: [PATCH 23/73] WIP --- .../ViewTypes/ListWithGroupedStyleTests.swift | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift index a0698154..f7f3ec6b 100644 --- a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift @@ -1,41 +1,38 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ListWithGroupedStyleTests: XCTestCase { +@Suite +struct ListWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView #endif - func testListWithGroupedStyle() { - XCTAssertViewIntrospection(of: PlatformListWithGroupedStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithGroupedStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.grouped) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } - .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .grouped), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) + .introspect(.list(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.grouped) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From b6af55e62e745400ef88c277258294cfde3f6164 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:00:33 +0100 Subject: [PATCH 24/73] WIP --- .../ProgressViewWithCircularStyleTests.swift | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift index 71d18158..571c89e4 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift @@ -1,56 +1,48 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ProgressViewWithCircularStyleTests: XCTestCase { +@Suite +struct ProgressViewWithCircularStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithCircularStyle = UIActivityIndicatorView #elseif canImport(AppKit) typealias PlatformProgressViewWithCircularStyle = NSProgressIndicator #endif - func testProgressViewWithCircularStyle() throws { - guard #available(iOS 14, tvOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformProgressViewWithCircularStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformProgressViewWithCircularStyle.self) { spy1, spy2, spy3 in VStack { ProgressView(value: 0.25) .progressViewStyle(.circular) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif ProgressView(value: 0.5) .progressViewStyle(.circular) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif ProgressView(value: 0.75) .progressViewStyle(.circular) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.progressView(style: .circular), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.progressView(style: .circular), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.doubleValue, 0.25) - XCTAssertEqual($0[safe: 1]?.doubleValue, 0.5) - XCTAssertEqual($0[safe: 2]?.doubleValue, 0.75) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.doubleValue == 0.25) + #expect(entity2.doubleValue == 0.5) + #expect(entity3.doubleValue == 0.75) + #endif } } From 61bcff50c9e427ddd5aab6caa3e85c493b6193ff Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:01:43 +0100 Subject: [PATCH 25/73] WIP --- Tests/Tests/ViewTypes/ListCellTests.swift | 29 ++++++++++------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListCellTests.swift b/Tests/Tests/ViewTypes/ListCellTests.swift index e95c6f7c..4ccad641 100644 --- a/Tests/Tests/ViewTypes/ListCellTests.swift +++ b/Tests/Tests/ViewTypes/ListCellTests.swift @@ -1,42 +1,39 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ListCellTests: XCTestCase { +@Suite +struct ListCellTests { #if canImport(UIKit) typealias PlatformListCell = UIView // covers both UITableViewCell and UICollectionViewCell #elseif canImport(AppKit) typealias PlatformListCell = NSTableCellView #endif - func testListCell() { - XCTAssertViewIntrospection(of: PlatformListCell.self) { spies in - let spy = spies[0] - + @Test func introspect() async throws { + try await introspection(of: PlatformListCell.self) { spy in List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.listCell, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy($0) } - .introspect(.listCell, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy($0) } + .introspect(.listCell, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy) + .introspect(.listCell, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) #elseif os(macOS) - .introspect(.listCell, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy($0) } + .introspect(.listCell, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy) #endif } } } - func testMaskedListCell() { - XCTAssertViewIntrospection(of: PlatformListCell.self) { spies in - let spy = spies[0] - + @Test func introspectMasked() async throws { + try await introspection(of: PlatformListCell.self) { spy in List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.listCell, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy($0) } - .introspect(.listCell, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy($0) } + .introspect(.listCell, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy) + .introspect(.listCell, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy) #elseif os(macOS) - .introspect(.listCell, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy($0) } + .introspect(.listCell, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy) #endif .clipped() .clipShape(RoundedRectangle(cornerRadius: 20.0)) From 536e004b1470bdd4660fc7c8f8b00fbf53844f97 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:03:17 +0100 Subject: [PATCH 26/73] WIP --- .../ToggleWithSwitchStyleTests.swift | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift index 2f195621..bfd0365e 100644 --- a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift @@ -1,58 +1,54 @@ #if !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ToggleWithSwitchStyleTests: XCTestCase { +@Suite +struct ToggleWithSwitchStyleTests { #if canImport(UIKit) typealias PlatformToggleWithSwitchStyle = UISwitch #elseif canImport(AppKit) typealias PlatformToggleWithSwitchStyle = NSSwitch #endif - func testToggleWithSwitchStyle() { - XCTAssertViewIntrospection(of: PlatformToggleWithSwitchStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformToggleWithSwitchStyle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) .toggleStyle(.switch) #if os(iOS) - .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy0) + .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Toggle("", isOn: .constant(false)) .toggleStyle(.switch) #if os(iOS) - .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) #elseif os(macOS) - .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif Toggle("", isOn: .constant(true)) .toggleStyle(.switch) #if os(iOS) - .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) + .introspect(.toggle(style: .switch), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy3) #elseif os(macOS) - .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.toggle(style: .switch), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.isOn, true) - XCTAssertEqual($0[safe: 1]?.isOn, false) - XCTAssertEqual($0[safe: 2]?.isOn, true) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.state, .on) - XCTAssertEqual($0[safe: 1]?.state, .off) - XCTAssertEqual($0[safe: 2]?.state, .on) - #endif } + #if canImport(UIKit) + #expect(entity1.isOn == true) + #expect(entity2.isOn == false) + #expect(entity3.isOn == true) + #elseif canImport(AppKit) + #expect(entity1.state == .on) + #expect(entity2.state == .off) + #expect(entity3.state == .on) + #endif } } #endif From feac3277da491d0a80e9105ddd26fbe3e64ea4e7 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:04:51 +0100 Subject: [PATCH 27/73] WIP --- Tests/Tests/ViewTypes/DatePickerTests.swift | 54 ++++++++++----------- 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerTests.swift b/Tests/Tests/ViewTypes/DatePickerTests.swift index 07a2527b..e6b515a4 100644 --- a/Tests/Tests/ViewTypes/DatePickerTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerTests.swift @@ -1,35 +1,24 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class DatePickerTests: XCTestCase { +@Suite +struct DatePickerTests { #if canImport(UIKit) typealias PlatformDatePicker = UIDatePicker #elseif canImport(AppKit) typealias PlatformDatePicker = NSDatePicker #endif - func testDatePicker() { - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 5) - let date2 = Date(timeIntervalSince1970: 10) - - XCTAssertViewIntrospection(of: PlatformDatePicker.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 5) + let date3 = Date(timeIntervalSince1970: 10) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePicker.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) - #if os(iOS) || os(visionOS) - .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - .cornerRadius(8) - DatePicker("", selection: .constant(date1)) #if os(iOS) || os(visionOS) .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -44,18 +33,25 @@ final class DatePickerTests: XCTestCase { #elseif os(macOS) .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + .cornerRadius(8) + + DatePicker("", selection: .constant(date3)) + #if os(iOS) || os(visionOS) + .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.date, date0) - XCTAssertEqual($0[safe: 1]?.date, date1) - XCTAssertEqual($0[safe: 2]?.date, date2) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.dateValue, date0) - XCTAssertEqual($0[safe: 1]?.dateValue, date1) - XCTAssertEqual($0[safe: 2]?.dateValue, date2) - #endif } + #if canImport(UIKit) + #expect(entity1.date == date1) + #expect(entity2.date == date2) + #expect(entity3.date == date3) + #elseif canImport(AppKit) + #expect(entity1.dateValue == date1) + #expect(entity2.dateValue == date2) + #expect(entity3.dateValue == date3) + #endif } } #endif From e2dd46565443205905e767fa55b84517bc50b0cb Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:08:26 +0100 Subject: [PATCH 28/73] WIP --- Tests/Tests/ViewTypes/TableTests.swift | 75 ++++++++++---------------- 1 file changed, 27 insertions(+), 48 deletions(-) diff --git a/Tests/Tests/ViewTypes/TableTests.swift b/Tests/Tests/ViewTypes/TableTests.swift index b0785a66..23466983 100644 --- a/Tests/Tests/ViewTypes/TableTests.swift +++ b/Tests/Tests/ViewTypes/TableTests.swift @@ -1,118 +1,97 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 16, macOS 12, *) @MainActor -final class TableTests: XCTestCase { +@Suite +struct TableTests { #if canImport(UIKit) typealias PlatformTable = UICollectionView #elseif canImport(AppKit) typealias PlatformTable = NSTableView #endif - func testTable() throws { - guard #available(iOS 16, macOS 12, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTable.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @available(iOS 16, macOS 12, *) + @Test func introspect() async throws { + try await introspection(of: PlatformTable.self) { spy1, spy2, spy3 in VStack { TipTable() #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) #endif TipTable() #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) #endif TipTable() #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } } } - func testTableWithInsetStyle() throws { - guard #available(iOS 16, macOS 12, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTable.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @available(iOS 16, macOS 12, *) + @Test func introspectWithInsetStyle() async throws { + try await introspection(of: PlatformTable.self) { spy1, spy2, spy3 in VStack { TipTable() .tableStyle(.inset) #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) #endif TipTable() .tableStyle(.inset) #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) #endif TipTable() .tableStyle(.inset) #if os(iOS) || os(visionOS) - .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.table, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } } } #if os(macOS) - func testTableWithBorderedStyle() throws { - guard #available(macOS 12, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTable.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @available(macOS 12, *) + func testTableWithBorderedStyle() async throws { + try await introspection(of: PlatformTable.self) { spy1, spy2, spy3 in VStack { TipTable() .tableStyle(.bordered) #if os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) #endif TipTable() .tableStyle(.bordered) #if os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) #endif TipTable() .tableStyle(.bordered) #if os(macOS) - .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.table, on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } } From 9a159b5931de4d839eb144df3ad81786a15515ea Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:09:51 +0100 Subject: [PATCH 29/73] WIP --- .../ViewTypes/ListWithInsetStyleTests.swift | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift index 22a87262..0482416e 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift @@ -1,52 +1,44 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, macOS 11, *) @MainActor -final class ListWithInsetStyleTests: XCTestCase { +@Suite +struct ListWithInsetStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetStyle = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformListWithInsetStyle = NSTableView #endif - func testListWithInsetStyle() throws { - guard #available(iOS 14, macOS 11, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformListWithInsetStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithInsetStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.inset) #if os(iOS) || os(visionOS) - .introspect(.list(style: .inset), on: .iOS(.v14, .v15)) { spy0($0) } - .introspect(.list(style: .inset), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list(style: .inset), on: .iOS(.v14, .v15), customize: spy1) + .introspect(.list(style: .inset), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.list(style: .inset), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list(style: .inset), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(visionOS) - .introspect(.list(style: .inset), on: .iOS(.v14, .v15), scope: .ancestor) { spy1($0) } - .introspect(.list(style: .inset), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .inset), on: .iOS(.v14, .v15), scope: .ancestor, customize: spy2) + .introspect(.list(style: .inset), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.list(style: .inset), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .inset), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.inset) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From db5e7662c7b1e9dc1e9ca00b6df3d620e57db0d1 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:13:31 +0100 Subject: [PATCH 30/73] WIP --- Tests/Tests/ViewTypes/ButtonTests.swift | 29 ++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/Tests/Tests/ViewTypes/ButtonTests.swift b/Tests/Tests/ViewTypes/ButtonTests.swift index f155f258..1c15314f 100644 --- a/Tests/Tests/ViewTypes/ButtonTests.swift +++ b/Tests/Tests/ViewTypes/ButtonTests.swift @@ -1,50 +1,45 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ButtonTests: XCTestCase { +@Suite +struct ButtonTests { #if canImport(AppKit) typealias PlatformButton = NSButton #endif - func testButton() { - XCTAssertViewIntrospection(of: PlatformButton.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - let spy3 = spies[3] - + @Test func introspect() async throws { + let (entity1, entity2, entity3, entity4) = try await introspection(of: PlatformButton.self) { spy1, spy2, spy3, spy4 in VStack { Button("Button 0", action: {}) .buttonStyle(.bordered) #if os(macOS) - .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Button("Button 1", action: {}) .buttonStyle(.borderless) #if os(macOS) - .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif Button("Button 2", action: {}) .buttonStyle(.link) #if os(macOS) - .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif Button("Button 3", action: {}) #if os(macOS) - .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy4) #endif } - } extraAssertions: { - #if canImport(AppKit) - XCTAssert(Set($0.map(ObjectIdentifier.init)).count == 4) - #endif } + #if canImport(AppKit) + #expect(Set([entity1, entity2, entity3, entity4].map(ObjectIdentifier.init)).count == 4) + #endif } } #endif From dafb481da936cb54d7c5589f2709590f3642b7e3 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:13:32 +0100 Subject: [PATCH 31/73] WIP --- ...DatePickerWithCompactFieldStyleTests.swift | 61 ++++++++----------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift index 237812e9..d1a9379a 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift @@ -1,41 +1,24 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, macOS 10.15.4, *) @MainActor -final class DatePickerWithCompactStyleTests: XCTestCase { +@Suite +struct DatePickerWithCompactStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithCompactStyle = UIDatePicker #elseif canImport(AppKit) typealias PlatformDatePickerWithCompactStyle = NSDatePicker #endif - func testDatePickerWithCompactStyle() throws { - guard #available(iOS 14, macOS 10.15.4, *) else { - throw XCTSkip() - } - - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 5) - let date2 = Date(timeIntervalSince1970: 10) - - XCTAssertViewIntrospection(of: PlatformDatePickerWithCompactStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 5) + let date3 = Date(timeIntervalSince1970: 10) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePickerWithCompactStyle.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) - .datePickerStyle(.compact) - #if os(iOS) || os(visionOS) - .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - .cornerRadius(8) - DatePicker("", selection: .constant(date1)) .datePickerStyle(.compact) #if os(iOS) || os(visionOS) @@ -52,18 +35,26 @@ final class DatePickerWithCompactStyleTests: XCTestCase { #elseif os(macOS) .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + .cornerRadius(8) + + DatePicker("", selection: .constant(date3)) + .datePickerStyle(.compact) + #if os(iOS) || os(visionOS) + .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.date, date0) - XCTAssertEqual($0[safe: 1]?.date, date1) - XCTAssertEqual($0[safe: 2]?.date, date2) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.dateValue, date0) - XCTAssertEqual($0[safe: 1]?.dateValue, date1) - XCTAssertEqual($0[safe: 2]?.dateValue, date2) - #endif } + #if canImport(UIKit) + #expect(entity1.date == date1) + #expect(entity2.date == date2) + #expect(entity3.date == date3) + #elseif canImport(AppKit) + #expect(entity1.dateValue == date1) + #expect(entity2.dateValue == date2) + #expect(entity3.dateValue == date3) + #endif } } #endif From 1f9fa0c322da7b05f66d9ea15bdd91d5064b9f51 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:14:42 +0100 Subject: [PATCH 32/73] WIP --- .../DatePickerWithFieldStyleTests.swift | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift index b3227df3..3cf6fff1 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift @@ -1,52 +1,48 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class DatePickerWithFieldStyleTests: XCTestCase { +@Suite +struct DatePickerWithFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithFieldStyle = NSDatePicker #endif - func testDatePickerWithFieldStyle() { - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 5) - let date2 = Date(timeIntervalSince1970: 10) - - XCTAssertViewIntrospection(of: PlatformDatePickerWithFieldStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 5) + let date3 = Date(timeIntervalSince1970: 10) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePickerWithFieldStyle.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) + DatePicker("", selection: .constant(date1)) .datePickerStyle(.field) #if os(macOS) - .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date1)) + DatePicker("", selection: .constant(date2)) .datePickerStyle(.field) #if os(macOS) - .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date2)) + DatePicker("", selection: .constant(date3)) .datePickerStyle(.field) #if os(macOS) - .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.datePicker(style: .field), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.dateValue, date0) - XCTAssertEqual($0[safe: 1]?.dateValue, date1) - XCTAssertEqual($0[safe: 2]?.dateValue, date2) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.dateValue == date1) + #expect(entity2.dateValue == date2) + #expect(entity3.dateValue == date3) + #endif } } #endif From 32b40fb1ae5df841a3e86e5ed064fcc43c398b09 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:16:38 +0100 Subject: [PATCH 33/73] WIP --- .../DatePickerWithGraphicalStyleTests.swift | 61 ++++++++----------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift index 0fa485b2..3034bfdc 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift @@ -1,41 +1,24 @@ #if !os(tvOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, *) @MainActor -final class DatePickerWithGraphicalStyleTests: XCTestCase { +@Suite +struct DatePickerWithGraphicalStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithGraphicalStyle = UIDatePicker #elseif canImport(AppKit) typealias PlatformDatePickerWithGraphicalStyle = NSDatePicker #endif - func testDatePickerWithGraphicalStyle() throws { - guard #available(iOS 14, *) else { - throw XCTSkip() - } - - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 3600 * 24 * 1) - let date2 = Date(timeIntervalSince1970: 3600 * 24 * 2) - - XCTAssertViewIntrospection(of: PlatformDatePickerWithGraphicalStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 3600 * 24 * 1) + let date3 = Date(timeIntervalSince1970: 3600 * 24 * 2) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePickerWithGraphicalStyle.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) - .datePickerStyle(.graphical) - #if os(iOS) || os(visionOS) - .introspect(.datePicker(style: .graphical), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.datePicker(style: .graphical), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - .cornerRadius(8) - DatePicker("", selection: .constant(date1)) .datePickerStyle(.graphical) #if os(iOS) || os(visionOS) @@ -52,18 +35,26 @@ final class DatePickerWithGraphicalStyleTests: XCTestCase { #elseif os(macOS) .introspect(.datePicker(style: .graphical), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + .cornerRadius(8) + + DatePicker("", selection: .constant(date3)) + .datePickerStyle(.graphical) + #if os(iOS) || os(visionOS) + .introspect(.datePicker(style: .graphical), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.datePicker(style: .graphical), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.date, date0) - XCTAssertEqual($0[safe: 1]?.date, date1) - XCTAssertEqual($0[safe: 2]?.date, date2) - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.dateValue, date0) - XCTAssertEqual($0[safe: 1]?.dateValue, date1) - XCTAssertEqual($0[safe: 2]?.dateValue, date2) - #endif } + #if canImport(UIKit) + #expect(entity1.date == date1) + #expect(entity2.date == date2) + #expect(entity3.date == date3) + #elseif canImport(AppKit) + #expect(entity1.dateValue == date1) + #expect(entity2.dateValue == date2) + #expect(entity3.dateValue == date3) + #endif } } #endif From 2ed6d0493ecfb4dd3dd0913e16183b4ea595b443 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:18:25 +0100 Subject: [PATCH 34/73] WIP --- ...DatePickerWithStepperFieldStyleTests.swift | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index a333a94c..5837d954 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -1,52 +1,47 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class DatePickerWithStepperFieldStyleTests: XCTestCase { +@Suite struct DatePickerWithStepperFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker #endif - func testDatePickerWithStepperFieldStyle() { - let date0 = Date(timeIntervalSince1970: 0) - let date1 = Date(timeIntervalSince1970: 5) - let date2 = Date(timeIntervalSince1970: 10) - - XCTAssertViewIntrospection(of: PlatformDatePickerWithStepperFieldStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let date1 = Date(timeIntervalSince1970: 0) + let date2 = Date(timeIntervalSince1970: 5) + let date3 = Date(timeIntervalSince1970: 10) + let (entity1, entity2, entity3) = try await introspection(of: PlatformDatePickerWithStepperFieldStyle.self) { spy1, spy2, spy3 in VStack { - DatePicker("", selection: .constant(date0)) + DatePicker("", selection: .constant(date1)) .datePickerStyle(.stepperField) #if os(macOS) - .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date1)) + DatePicker("", selection: .constant(date2)) .datePickerStyle(.stepperField) #if os(macOS) - .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) - DatePicker("", selection: .constant(date2)) + DatePicker("", selection: .constant(date3)) .datePickerStyle(.stepperField) #if os(macOS) - .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.datePicker(style: .stepperField), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.dateValue, date0) - XCTAssertEqual($0[safe: 1]?.dateValue, date1) - XCTAssertEqual($0[safe: 2]?.dateValue, date2) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.dateValue == date1) + #expect(entity2.dateValue == date3) + #expect(entity3.dateValue == date2) + #endif } } #endif From a37d38c7b47e9e36149e551931c227927b71074b Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:19:46 +0100 Subject: [PATCH 35/73] WIP --- .../ViewTypes/FormWithGroupedStyleTests.swift | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift index 0297fadc..0e3ed041 100644 --- a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift @@ -1,50 +1,43 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 16, tvOS 16, macOS 13, *) @MainActor -final class FormWithGroupedStyleTests: XCTestCase { +@Suite +struct FormWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformFormWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformFormWithGroupedStyle = NSScrollView #endif - func testFormWithGroupedStyle() throws { - guard #available(iOS 16, tvOS 16, macOS 13, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformFormWithGroupedStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @available(iOS 16, tvOS 16, macOS 13, *) + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformFormWithGroupedStyle.self) { spy1, spy2 in HStack { Form { Text("Item 1") } .formStyle(.grouped) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.form(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } - .introspect(.form(style: .grouped), on: .tvOS(.v16, .v17, .v18, .v26)) { spy0($0) } + .introspect(.form(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.form(style: .grouped), on: .tvOS(.v16, .v17, .v18, .v26), customize: spy1) #elseif os(macOS) - .introspect(.form(style: .grouped), on: .macOS(.v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.form(style: .grouped), on: .macOS(.v13, .v14, .v15, .v26), customize: spy1) #endif Form { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.form(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } - .introspect(.form(style: .grouped), on: .tvOS(.v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } + .introspect(.form(style: .grouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) + .introspect(.form(style: .grouped), on: .tvOS(.v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.form(style: .grouped), on: .macOS(.v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.form(style: .grouped), on: .macOS(.v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } .formStyle(.grouped) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } From 26fa38ceb9a367aa6d7ca39095c98cdbb5cc9310 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:20:43 +0100 Subject: [PATCH 36/73] WIP --- .../Tests/ViewTypes/FullScreenCoverTests.swift | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift index 563d95db..421271f8 100644 --- a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift +++ b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift @@ -1,19 +1,13 @@ #if !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, tvOS 14, *) @MainActor -final class FullScreenCoverTests: XCTestCase { - func testPresentationAsFullScreenCover() throws { - guard #available(iOS 14, tvOS 14, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: UIPresentationController.self) { spies in - let spy0 = spies[0] - +@Suite +struct FullScreenCoverTests { + @Test func introspect() async throws { + try await introspection(of: UIPresentationController.self) { spy in Text("Root") .fullScreenCover(isPresented: .constant(true)) { Text("Content") @@ -21,7 +15,7 @@ final class FullScreenCoverTests: XCTestCase { .introspect( .fullScreenCover, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), - customize: spy0 + customize: spy ) #endif } From 742e715e0c05240417da22d847c8f6782fcaf7b9 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:23:26 +0100 Subject: [PATCH 37/73] WIP --- Tests/Tests/ViewTypes/ListTests.swift | 67 +++++++++++---------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListTests.swift b/Tests/Tests/ViewTypes/ListTests.swift index 8dafe2fd..e8cf9b37 100644 --- a/Tests/Tests/ViewTypes/ListTests.swift +++ b/Tests/Tests/ViewTypes/ListTests.swift @@ -1,52 +1,46 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ListTests: XCTestCase { +@Suite +struct ListTests { #if canImport(UIKit) typealias PlatformList = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformList = NSTableView #endif - func testList() { - XCTAssertViewIntrospection(of: PlatformList.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformList.self) { spy1, spy2 in HStack { List { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } #if !os(macOS) - func testNestedList() { - XCTAssertViewIntrospection(of: PlatformList.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspectNested() async throws { + let (entity1, entity2) = try await introspection(of: PlatformList.self) { spy1, spy2 in List { Text("Item 1") @@ -54,34 +48,30 @@ final class ListTests: XCTestCase { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy1($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy1($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy2) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #endif } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } #endif - func testMaskedList() { - XCTAssertViewIntrospection(of: PlatformList.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspectMasked() async throws { + let (entity1, entity2) = try await introspection(of: PlatformList.self) { spy1, spy2 in HStack { List { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .clipped() .clipShape(RoundedRectangle(cornerRadius: 20.0)) @@ -90,15 +80,14 @@ final class ListTests: XCTestCase { List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } - .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) + .introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } From 4e45b5323922af48a9165ca8a540329a7b3d80dd Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:24:59 +0100 Subject: [PATCH 38/73] WIP --- .../ListWithBorderedStyleTests.swift | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift index 6f28505f..dd9603d5 100644 --- a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift @@ -1,44 +1,37 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(macOS 12, *) @MainActor -final class ListWithBorderedStyleTests: XCTestCase { +@Suite +struct ListWithBorderedStyleTests { #if canImport(AppKit) typealias PlatformListWithBorderedStyle = NSTableView #endif - func testListWithBorderedStyle() throws { - guard #available(macOS 12, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformListWithBorderedStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @available(macOS 12, *) + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithBorderedStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.bordered) #if os(macOS) - .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) #endif List { Text("Item 1") #if os(macOS) - .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .bordered), on: .macOS(.v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.bordered) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From 6ebb581a33634bf77386d7a113f38b2db44f747a Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:27:05 +0100 Subject: [PATCH 39/73] WIP --- .../ListWithInsetGroupedStyleTests.swift | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index aad000d9..882fa999 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -1,46 +1,38 @@ #if !os(tvOS) && !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, *) @MainActor -final class ListWithInsetGroupedStyleTests: XCTestCase { +@Suite +struct ListWithInsetGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView #endif - func testListWithInsetGroupedStyle() throws { - guard #available(iOS 14, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformListWithInsetGroupedStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func testListWithInsetGroupedStyle() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithInsetGroupedStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.insetGrouped) #if os(iOS) || os(visionOS) - .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15)) { spy0($0) } - .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15), customize: spy1) + .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(visionOS) - .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15), scope: .ancestor) { spy1($0) } - .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .insetGrouped), on: .iOS(.v14, .v15), scope: .ancestor, customize: spy2) + .introspect(.list(style: .insetGrouped), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.insetGrouped) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } #endif From dca477868aea179ab188d8ee55b1d04cd6a00d4a Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:28:39 +0100 Subject: [PATCH 40/73] WIP --- .../ViewTypes/ListWithPlainStyleTests.swift | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift index b170db52..5b462575 100644 --- a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift @@ -1,45 +1,42 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ListWithPlainStyleTests: XCTestCase { +@Suite +struct ListWithPlainStyleTests { #if canImport(UIKit) typealias PlatformListWithPlainStyle = UIScrollView // covers both UITableView and UICollectionView #elseif canImport(AppKit) typealias PlatformListWithPlainStyle = NSTableView #endif - func testListWithPlainStyle() { - XCTAssertViewIntrospection(of: PlatformListWithPlainStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformListWithPlainStyle.self) { spy1, spy2 in HStack { List { Text("Item 1") } .listStyle(.plain) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list(style: .plain), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { spy0($0) } - .introspect(.list(style: .plain), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26)) { spy0($0) } + .introspect(.list(style: .plain), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), customize: spy1) + .introspect(.list(style: .plain), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.list(style: .plain), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) { spy0($0) } + .introspect(.list(style: .plain), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif List { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.list(style: .plain), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { spy1($0) } - .introspect(.list(style: .plain), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .plain), on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor, customize: spy2) + .introspect(.list(style: .plain), on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.list(style: .plain), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor) { spy1($0) } + .introspect(.list(style: .plain), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } .listStyle(.plain) } - } extraAssertions: { - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #expect(entity1 !== entity2) } } From 603ecc057c97ed9acc80000fe1c10dc2b45f0de7 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:30:52 +0100 Subject: [PATCH 41/73] WIP --- .../ViewTypes/NavigationSplitViewTests.swift | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift index f895a182..5cbf7cac 100644 --- a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift +++ b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift @@ -1,10 +1,10 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 16, tvOS 16, macOS 13, *) @MainActor -final class NavigationSplitViewTests: XCTestCase { +@Suite +struct NavigationSplitViewTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationSplitView = UISplitViewController #elseif canImport(UIKit) && os(tvOS) @@ -13,17 +13,10 @@ final class NavigationSplitViewTests: XCTestCase { typealias PlatformNavigationSplitView = NSSplitView #endif - func testNavigationSplitView() throws { - guard #available(iOS 16, tvOS 16, macOS 13, *) else { - throw XCTSkip() - } - guard #unavailable(tvOS 18) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in - let spy = spies[0] - + @available(iOS 16, macOS 13, *) + @available(tvOS, introduced: 16, obsoleted: 18) + @Test func introspect() async throws { + try await introspection(of: PlatformNavigationSplitView.self) { spy in NavigationSplitView { ZStack { Color.red @@ -45,17 +38,10 @@ final class NavigationSplitViewTests: XCTestCase { } } - func testNavigationSplitViewAsAncestor() throws { - guard #available(iOS 16, tvOS 16, macOS 13, *) else { - throw XCTSkip() - } - guard #unavailable(tvOS 18) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformNavigationSplitView.self) { spies in - let spy = spies[0] - + @available(iOS 16, macOS 13, *) + @available(tvOS, introduced: 16, obsoleted: 18) + @Test func introspectAsAncestor() async throws { + try await introspection(of: PlatformNavigationSplitView.self) { spy in // NB: columnVisibility is explicitly set here for ancestor introspection to work, because initially on iPad the sidebar is hidden, so the introspection modifier isn't triggered until the user makes the sidebar appear. This is why ancestor introspection is discouraged for most situations and it's opt-in. NavigationSplitView(columnVisibility: .constant(.all)) { ZStack { From 17b537d401afbca1ebcffe439d566649403a863e Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:32:35 +0100 Subject: [PATCH 42/73] WIP --- .../ViewTypes/NavigationStackTests.swift | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/Tests/Tests/ViewTypes/NavigationStackTests.swift b/Tests/Tests/ViewTypes/NavigationStackTests.swift index a5ffd787..6dba62c9 100644 --- a/Tests/Tests/ViewTypes/NavigationStackTests.swift +++ b/Tests/Tests/ViewTypes/NavigationStackTests.swift @@ -1,23 +1,18 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 16, tvOS 16, *) @MainActor -final class NavigationStackTests: XCTestCase { +@Suite +struct NavigationStackTests { #if canImport(UIKit) typealias PlatformNavigationStack = UINavigationController #endif - func testNavigationStack() throws { - guard #available(iOS 16, tvOS 16, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformNavigationStack.self) { spies in - let spy = spies[0] - + @available(iOS 16, tvOS 16, *) + @Test func introspect() async throws { + try await introspection(of: PlatformNavigationStack.self) { spy in NavigationStack { ZStack { Color.red @@ -30,14 +25,9 @@ final class NavigationStackTests: XCTestCase { } } - func testNavigationStackAsAncestor() throws { - guard #available(iOS 16, tvOS 16, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformNavigationStack.self) { spies in - let spy = spies[0] - + @available(iOS 16, tvOS 16, *) + @Test func introspectAsAncestor() async throws { + try await introspection(of: PlatformNavigationStack.self) { spy in NavigationStack { ZStack { Color.red From e58da8e853e33d9e60ec84b82af870fbcbc67b88 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:34:52 +0100 Subject: [PATCH 43/73] WIP --- .../ViewTypes/PickerWithMenuStyleTests.swift | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift index 8bd0ce65..a836a04e 100644 --- a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift @@ -1,27 +1,24 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class PickerWithMenuStyleTests: XCTestCase { +@Suite +struct PickerWithMenuStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformPickerWithMenuStyle = NSPopUpButton #endif - func testPickerWithMenuStyle() { - XCTAssertViewIntrospection(of: PlatformPickerWithMenuStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformPickerWithMenuStyle.self) { spy1, spy2, spy3 in VStack { Picker("Pick", selection: .constant("1")) { Text("1").tag("1") } .pickerStyle(.menu) #if os(macOS) - .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .cornerRadius(8) @@ -31,7 +28,7 @@ final class PickerWithMenuStyleTests: XCTestCase { } .pickerStyle(.menu) #if os(macOS) - .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif .cornerRadius(8) @@ -42,16 +39,15 @@ final class PickerWithMenuStyleTests: XCTestCase { } .pickerStyle(.menu) #if os(macOS) - .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.picker(style: .menu), on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.numberOfItems, 1) - XCTAssertEqual($0[safe: 1]?.numberOfItems, 2) - XCTAssertEqual($0[safe: 2]?.numberOfItems, 3) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.numberOfItems == 1) + #expect(entity2.numberOfItems == 2) + #expect(entity3.numberOfItems == 3) + #endif } } #endif From d72aaa721b45ecf123a6638d64e4979a82e340f6 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:34:54 +0100 Subject: [PATCH 44/73] WIP --- .../ViewTypes/PickerWithWheelStyleTests.swift | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift index 63a9ceb6..de1bfaa6 100644 --- a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift @@ -1,27 +1,24 @@ #if !os(tvOS) && !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class PickerWithWheelStyleTests: XCTestCase { +@Suite +struct PickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformPickerWithWheelStyle = UIPickerView #endif - func testPickerWithWheelStyle() { - XCTAssertViewIntrospection(of: PlatformPickerWithWheelStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformPickerWithWheelStyle.self) { spy1, spy2, spy3 in VStack { Picker("Pick", selection: .constant("1")) { Text("1").tag("1") } .pickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #endif .cornerRadius(8) @@ -31,7 +28,7 @@ final class PickerWithWheelStyleTests: XCTestCase { } .pickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #endif .cornerRadius(8) @@ -42,16 +39,15 @@ final class PickerWithWheelStyleTests: XCTestCase { } .pickerStyle(.wheel) #if os(iOS) || os(visionOS) - .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) + .introspect(.picker(style: .wheel), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.numberOfRows(inComponent: 0), 1) - XCTAssertEqual($0[safe: 1]?.numberOfRows(inComponent: 0), 2) - XCTAssertEqual($0[safe: 2]?.numberOfRows(inComponent: 0), 3) - #endif } + #if canImport(UIKit) + #expect(entity1.numberOfRows(inComponent: 0) == 1) + #expect(entity2.numberOfRows(inComponent: 0) == 2) + #expect(entity3.numberOfRows(inComponent: 0) == 3) + #endif } } #endif From fb83758e0d236864eea67358fda1c3c4ef0d92fb Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:38:57 +0100 Subject: [PATCH 45/73] WIP --- Tests/Tests/ViewTypes/ScrollViewTests.swift | 116 ++++++++------------ 1 file changed, 48 insertions(+), 68 deletions(-) diff --git a/Tests/Tests/ViewTypes/ScrollViewTests.swift b/Tests/Tests/ViewTypes/ScrollViewTests.swift index 30d7f223..2059f9f2 100644 --- a/Tests/Tests/ViewTypes/ScrollViewTests.swift +++ b/Tests/Tests/ViewTypes/ScrollViewTests.swift @@ -1,60 +1,51 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ScrollViewTests: XCTestCase { +@Suite +struct ScrollViewTests { #if canImport(UIKit) typealias PlatformScrollView = UIScrollView #elseif canImport(AppKit) typealias PlatformScrollView = NSScrollView #endif - func testScrollView() { - XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - + @Test func introspect() async throws { + let (entity1, entity2) = try await introspection(of: PlatformScrollView.self) { spy1, spy2 in HStack { ScrollView(showsIndicators: false) { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif ScrollView(showsIndicators: true) { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy1) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy1) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.showsVerticalScrollIndicator, false) - XCTAssertEqual($0[safe: 1]?.showsVerticalScrollIndicator, true) - #elseif canImport(AppKit) - // FIXME: these assertions don't pass on macOS 12, not sure why... maybe callback is too premature in relation to view lifecycle? - if #available(macOS 13, *) { - XCTAssert($0[safe: 0]?.verticalScroller == nil) - XCTAssert($0[safe: 1]?.verticalScroller != nil) - } - #endif - - XCTAssert($0[safe: 0] !== $0[safe: 1]) } - } + #if canImport(UIKit) + #expect(entity1.showsVerticalScrollIndicator == false) + #expect(entity2.showsVerticalScrollIndicator == true) + #elseif canImport(AppKit) + #expect(entity1.verticalScroller == nil) + #expect(entity2.verticalScroller != nil) + #endif - func testNestedScrollView() { - XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] + #expect(entity1 !== entity2) + } + @Test func introspectNested() async throws { + let (entity1, entity2) = try await introspection(of: PlatformScrollView.self) { spy1, spy2 in ScrollView(showsIndicators: true) { Text("Item 1") @@ -62,45 +53,38 @@ final class ScrollViewTests: XCTestCase { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy2) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.showsVerticalScrollIndicator, true) - XCTAssertEqual($0[safe: 1]?.showsVerticalScrollIndicator, false) - #elseif canImport(AppKit) - // FIXME: these assertions don't pass on macOS 12, not sure why... maybe callback is too premature in relation to view lifecycle? - if #available(macOS 13, *) { - XCTAssert($0[safe: 0]?.verticalScroller != nil) - XCTAssert($0[safe: 1]?.verticalScroller == nil) - } - #endif - - XCTAssert($0[safe: 0] !== $0[safe: 1]) } - } + #if canImport(UIKit) + #expect(entity1.showsVerticalScrollIndicator == true) + #expect(entity2.showsVerticalScrollIndicator == false) + #elseif canImport(AppKit) + #expect(entity1.verticalScroller != nil) + #expect(entity2.verticalScroller == nil) + #endif - func testMaskedScrollView() { - XCTAssertViewIntrospection(of: PlatformScrollView.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] + #expect(entity1 !== entity2) + } + @Test func introspectMasked() async throws { + let (entity1, entity2) = try await introspection(of: PlatformScrollView.self) { spy1, spy2 in HStack { ScrollView(showsIndicators: false) { Text("Item 1") } #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif .clipped() .clipShape(RoundedRectangle(cornerRadius: 20.0)) @@ -109,25 +93,21 @@ final class ScrollViewTests: XCTestCase { ScrollView(showsIndicators: true) { Text("Item 1") #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy1) + .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), scope: .ancestor, customize: spy2) #elseif os(macOS) - .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy1) + .introspect(.scrollView, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), scope: .ancestor, customize: spy2) #endif } } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.showsVerticalScrollIndicator, false) - XCTAssertEqual($0[safe: 1]?.showsVerticalScrollIndicator, true) - #elseif canImport(AppKit) - // FIXME: these assertions don't pass on macOS 12, not sure why... maybe callback is too premature in relation to view lifecycle? - if #available(macOS 13, *) { - XCTAssert($0[safe: 0]?.verticalScroller == nil) - XCTAssert($0[safe: 1]?.verticalScroller != nil) - } - #endif - - XCTAssert($0[safe: 0] !== $0[safe: 1]) } + #if canImport(UIKit) + #expect(entity1.showsVerticalScrollIndicator == false) + #expect(entity2.showsVerticalScrollIndicator == true) + #elseif canImport(AppKit) + #expect(entity1.verticalScroller == nil) + #expect(entity2.verticalScroller != nil) + #endif + + #expect(entity1 !== entity2) } } From d3ecceeab55cec00f1b263a76e9db6a8e8e3d45d Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:44:32 +0100 Subject: [PATCH 46/73] WIP --- Tests/Tests/ViewTypes/SecureFieldTests.swift | 89 +++++++++----------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/Tests/Tests/ViewTypes/SecureFieldTests.swift b/Tests/Tests/ViewTypes/SecureFieldTests.swift index a6127556..db5dc4d6 100644 --- a/Tests/Tests/ViewTypes/SecureFieldTests.swift +++ b/Tests/Tests/ViewTypes/SecureFieldTests.swift @@ -1,30 +1,19 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class SecureFieldTests: XCTestCase { +@Suite +struct SecureFieldTests { #if canImport(UIKit) typealias PlatformSecureField = UITextField #elseif canImport(AppKit) typealias PlatformSecureField = NSTextField #endif - func testSecureField() { - XCTAssertViewIntrospection(of: PlatformSecureField.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformSecureField.self) { spy1, spy2, spy3 in VStack { - SecureField("", text: .constant("Secure Field 0")) - #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - .cornerRadius(8) - SecureField("", text: .constant("Secure Field 1")) #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -39,34 +28,30 @@ final class SecureFieldTests: XCTestCase { #elseif os(macOS) .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif - } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Secure Field 0") - XCTAssertEqual($0[safe: 1]?.text, "Secure Field 1") - XCTAssertEqual($0[safe: 2]?.text, "Secure Field 2") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.stringValue, "Secure Field 0") - XCTAssertEqual($0[safe: 1]?.stringValue, "Secure Field 1") - XCTAssertEqual($0[safe: 2]?.stringValue, "Secure Field 2") - #endif - } - } - - func testSecureFieldsEmbeddedInList() { - XCTAssertViewIntrospection(of: PlatformSecureField.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + .cornerRadius(8) - List { - SecureField("", text: .constant("Secure Field 0")) + SecureField("", text: .constant("Secure Field 3")) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif + } + } + #if canImport(UIKit) + #expect(entity1.text == "Secure Field 1") + #expect(entity2.text == "Secure Field 2") + #expect(entity3.text == "Secure Field 3") + #elseif canImport(AppKit) + #expect(entity1.stringValue == "Secure Field 1") + #expect(entity2.stringValue == "Secure Field 2") + #expect(entity3.stringValue == "Secure Field 3") + #endif + } + @Test func introspectEmbeddedInList() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformSecureField.self) { spy1, spy2, spy3 in + List { SecureField("", text: .constant("Secure Field 1")) #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -80,17 +65,23 @@ final class SecureFieldTests: XCTestCase { #elseif os(macOS) .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + + SecureField("", text: .constant("Secure Field 3")) + #if os(iOS) || os(tvOS) || os(visionOS) + .introspect(.secureField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.secureField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Secure Field 0") - XCTAssertEqual($0[safe: 1]?.text, "Secure Field 1") - XCTAssertEqual($0[safe: 2]?.text, "Secure Field 2") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.stringValue, "Secure Field 0") - XCTAssertEqual($0[safe: 1]?.stringValue, "Secure Field 1") - XCTAssertEqual($0[safe: 2]?.stringValue, "Secure Field 2") - #endif } + #if canImport(UIKit) + #expect(entity1.text == "Secure Field 1") + #expect(entity2.text == "Secure Field 2") + #expect(entity3.text == "Secure Field 3") + #elseif canImport(AppKit) + #expect(entity1.stringValue == "Secure Field 1") + #expect(entity2.stringValue == "Secure Field 2") + #expect(entity3.stringValue == "Secure Field 3") + #endif } } From 9eb4de435ed0fca3ec67c3cbadd97570e664e38c Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:46:15 +0100 Subject: [PATCH 47/73] WIP --- Tests/Tests/ViewTypes/TabViewTests.swift | 27 ++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/Tests/Tests/ViewTypes/TabViewTests.swift b/Tests/Tests/ViewTypes/TabViewTests.swift index 1b7a63f6..0b520eb2 100644 --- a/Tests/Tests/ViewTypes/TabViewTests.swift +++ b/Tests/Tests/ViewTypes/TabViewTests.swift @@ -1,24 +1,20 @@ #if !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class TabViewTests: XCTestCase { +@Suite +struct TabViewTests { #if canImport(UIKit) typealias PlatformTabView = UITabBarController #elseif canImport(AppKit) typealias PlatformTabView = NSTabView #endif - func testTabView() throws { - guard #unavailable(macOS 15) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTabView.self) { spies in - let spy = spies[0] - + @available(macOS, introduced: 10.15, obsoleted: 15) + @Test func introspect() async throws { + try await introspection(of: PlatformTabView.self) { spy in TabView { ZStack { Color.red @@ -33,14 +29,9 @@ final class TabViewTests: XCTestCase { } } - func testTabViewAsAncestor() throws { - guard #unavailable(macOS 15) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformTabView.self) { spies in - let spy = spies[0] - + @available(macOS, introduced: 10.15, obsoleted: 15) + @Test func introspectAsAncestor() async throws { + try await introspection(of: PlatformTabView.self) { spy in TabView { ZStack { Color.red From 336d85a08b092c6581b729692f516bc49f4a18c0 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:49:09 +0100 Subject: [PATCH 48/73] WIP --- Tests/Tests/ViewTypes/TextFieldTests.swift | 89 ++++++++++------------ 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/Tests/Tests/ViewTypes/TextFieldTests.swift b/Tests/Tests/ViewTypes/TextFieldTests.swift index dd6232cf..169c6573 100644 --- a/Tests/Tests/ViewTypes/TextFieldTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldTests.swift @@ -1,30 +1,19 @@ import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class TextFieldTests: XCTestCase { +@Suite +struct TextFieldTests { #if canImport(UIKit) typealias PlatformTextField = UITextField #elseif canImport(AppKit) typealias PlatformTextField = NSTextField #endif - func testTextField() { - XCTAssertViewIntrospection(of: PlatformTextField.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformTextField.self) { spy1, spy2, spy3 in VStack { - TextField("", text: .constant("Text Field 0")) - #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - .cornerRadius(8) - TextField("", text: .constant("Text Field 1")) #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -39,34 +28,30 @@ final class TextFieldTests: XCTestCase { #elseif os(macOS) .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif - } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.text, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.text, "Text Field 2") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.stringValue, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.stringValue, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.stringValue, "Text Field 2") - #endif - } - } - - func testTextFieldsEmbeddedInList() { - XCTAssertViewIntrospection(of: PlatformTextField.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + .cornerRadius(8) - List { - TextField("", text: .constant("Text Field 0")) + TextField("", text: .constant("Text Field 3")) #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) + .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) #elseif os(macOS) - .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif + } + } + #if canImport(UIKit) + #expect(entity1.text == "Text Field 1") + #expect(entity2.text == "Text Field 2") + #expect(entity3.text == "Text Field 3") + #elseif canImport(AppKit) + #expect(entity1.stringValue == "Text Field 1") + #expect(entity2.stringValue == "Text Field 2") + #expect(entity3.stringValue == "Text Field 3") + #endif + } + @Test func introspectEmbeddedInList() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformTextField.self) { spy1, spy2, spy3 in + List { TextField("", text: .constant("Text Field 1")) #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -80,17 +65,23 @@ final class TextFieldTests: XCTestCase { #elseif os(macOS) .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + + TextField("", text: .constant("Text Field 3")) + #if os(iOS) || os(tvOS) || os(visionOS) + .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.textField, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - #if canImport(UIKit) - XCTAssertEqual($0[safe: 0]?.text, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.text, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.text, "Text Field 2") - #elseif canImport(AppKit) - XCTAssertEqual($0[safe: 0]?.stringValue, "Text Field 0") - XCTAssertEqual($0[safe: 1]?.stringValue, "Text Field 1") - XCTAssertEqual($0[safe: 2]?.stringValue, "Text Field 2") - #endif } + #if canImport(UIKit) + #expect(entity1.text == "Text Field 1") + #expect(entity2.text == "Text Field 2") + #expect(entity3.text == "Text Field 3") + #elseif canImport(AppKit) + #expect(entity1.stringValue == "Text Field 1") + #expect(entity2.stringValue == "Text Field 2") + #expect(entity3.stringValue == "Text Field 3") + #endif } } From 8859c97d43d35e11c4c9de470386a0bc5fdb45ed Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:52:09 +0100 Subject: [PATCH 49/73] WIP --- .../ToggleWithButtonStyleTests.swift | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift index 99972faf..2d64afbb 100644 --- a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift @@ -1,51 +1,43 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(macOS 12, *) @MainActor -final class ToggleWithButtonStyleTests: XCTestCase { +@Suite +struct ToggleWithButtonStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithButtonStyle = NSButton #endif - func testToggleWithButtonStyle() throws { - guard #available(macOS 12, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformToggleWithButtonStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @available(macOS 12, *) + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformToggleWithButtonStyle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) .toggleStyle(.button) #if os(macOS) - .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Toggle("", isOn: .constant(false)) .toggleStyle(.button) #if os(macOS) - .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) #endif Toggle("", isOn: .constant(true)) .toggleStyle(.button) #if os(macOS) - .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.toggle(style: .button), on: .macOS(.v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.state, .on) - XCTAssertEqual($0[safe: 1]?.state, .off) - XCTAssertEqual($0[safe: 2]?.state, .on) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.state == .on) + #expect(entity2.state == .off) + #expect(entity3.state == .on) + #endif } } #endif From f320bf963829495d1bb858082ca72be0d3e4dfaf Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:52:10 +0100 Subject: [PATCH 50/73] WIP --- .../ToggleWithCheckboxStyleTests.swift | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index 56deb095..e62edfb0 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -1,46 +1,42 @@ #if !os(iOS) && !os(tvOS) && !os(visionOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ToggleWithCheckboxStyleTests: XCTestCase { +@Suite +struct ToggleWithCheckboxStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithCheckboxStyle = NSButton #endif - func testToggleWithCheckboxStyle() throws { - XCTAssertViewIntrospection(of: PlatformToggleWithCheckboxStyle.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - + @Test func testToggleWithCheckboxStyle() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformToggleWithCheckboxStyle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) .toggleStyle(.checkbox) #if os(macOS) - .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) + .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) #endif Toggle("", isOn: .constant(false)) .toggleStyle(.checkbox) #if os(macOS) - .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy1) + .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif Toggle("", isOn: .constant(true)) .toggleStyle(.checkbox) #if os(macOS) - .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) + .introspect(.toggle(style: .checkbox), on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) #endif } - } extraAssertions: { - #if canImport(AppKit) && !targetEnvironment(macCatalyst) - XCTAssertEqual($0[safe: 0]?.state, .on) - XCTAssertEqual($0[safe: 1]?.state, .off) - XCTAssertEqual($0[safe: 2]?.state, .on) - #endif } + #if canImport(AppKit) && !targetEnvironment(macCatalyst) + #expect(entity1.state == .on) + #expect(entity2.state == .off) + #expect(entity3.state == .on) + #endif } } #endif From f53304d46b900050c17f72da9886215aae2591f9 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:53:53 +0100 Subject: [PATCH 51/73] WIP --- Tests/Tests/ViewTypes/VideoPlayerTests.swift | 45 ++++++++------------ 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/Tests/Tests/ViewTypes/VideoPlayerTests.swift b/Tests/Tests/ViewTypes/VideoPlayerTests.swift index ef820761..552e0a7b 100644 --- a/Tests/Tests/ViewTypes/VideoPlayerTests.swift +++ b/Tests/Tests/ViewTypes/VideoPlayerTests.swift @@ -2,39 +2,24 @@ import AVKit import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 14, tvOS 14, macOS 11, *) @MainActor -final class VideoPlayerTests: XCTestCase { +@Suite +struct VideoPlayerTests { #if canImport(UIKit) typealias PlatformVideoPlayer = AVPlayerViewController #elseif canImport(AppKit) typealias PlatformVideoPlayer = AVPlayerView #endif - func testVideoPlayer() throws { - guard #available(iOS 14, tvOS 14, macOS 11, *) else { - throw XCTSkip() - } - - let videoURL0 = URL(string: "https://bit.ly/swswift#1")! - let videoURL1 = URL(string: "https://bit.ly/swswift#2")! - let videoURL2 = URL(string: "https://bit.ly/swswift#3")! - - XCTAssertViewIntrospection(of: PlatformVideoPlayer.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] + @Test func introspect() async throws { + let videoURL1 = URL(string: "https://bit.ly/swswift#1")! + let videoURL2 = URL(string: "https://bit.ly/swswift#2")! + let videoURL3 = URL(string: "https://bit.ly/swswift#3")! + let (entity1, entity2, entity3) = try await introspection(of: PlatformVideoPlayer.self) { spy1, spy2, spy3 in VStack { - VideoPlayer(player: AVPlayer(url: videoURL0)) - #if os(iOS) || os(tvOS) || os(visionOS) - .introspect(.videoPlayer, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy0) - #elseif os(macOS) - .introspect(.videoPlayer, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy0) - #endif - VideoPlayer(player: AVPlayer(url: videoURL1)) #if os(iOS) || os(tvOS) || os(visionOS) .introspect(.videoPlayer, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy1) @@ -48,12 +33,18 @@ final class VideoPlayerTests: XCTestCase { #elseif os(macOS) .introspect(.videoPlayer, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy2) #endif + + VideoPlayer(player: AVPlayer(url: videoURL3)) + #if os(iOS) || os(tvOS) || os(visionOS) + .introspect(.videoPlayer, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), customize: spy3) + #elseif os(macOS) + .introspect(.videoPlayer, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26), customize: spy3) + #endif } - } extraAssertions: { - XCTAssertEqual(($0[safe: 0]?.player?.currentItem?.asset as? AVURLAsset)?.url, videoURL0) - XCTAssertEqual(($0[safe: 1]?.player?.currentItem?.asset as? AVURLAsset)?.url, videoURL1) - XCTAssertEqual(($0[safe: 2]?.player?.currentItem?.asset as? AVURLAsset)?.url, videoURL2) } + #expect((entity1.player?.currentItem?.asset as? AVURLAsset)?.url == videoURL1) + #expect((entity2.player?.currentItem?.asset as? AVURLAsset)?.url == videoURL2) + #expect((entity3.player?.currentItem?.asset as? AVURLAsset)?.url == videoURL3) } } #endif From 18a3174c6a4cef2c8aa2c6b8bbfd0da938635b7b Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 19:55:07 +0100 Subject: [PATCH 52/73] WIP --- Tests/Tests/ViewTypes/ButtonTests.swift | 2 +- Tests/Tests/ViewTypes/ColorPickerTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerTests.swift | 2 +- .../Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift | 2 +- .../Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift | 2 +- Tests/Tests/ViewTypes/FormTests.swift | 2 +- Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/FullScreenCoverTests.swift | 2 +- Tests/Tests/ViewTypes/ListCellTests.swift | 2 +- Tests/Tests/ViewTypes/ListTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift | 2 +- Tests/Tests/ViewTypes/MapTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationSplitViewTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationStackTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PageControlTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PopoverTests.swift | 2 +- Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ScrollViewTests.swift | 2 +- Tests/Tests/ViewTypes/SecureFieldTests.swift | 2 +- Tests/Tests/ViewTypes/SheetTests.swift | 2 +- Tests/Tests/ViewTypes/SliderTests.swift | 2 +- Tests/Tests/ViewTypes/StepperTests.swift | 2 +- Tests/Tests/ViewTypes/TabViewTests.swift | 2 +- Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift | 2 +- Tests/Tests/ViewTypes/TableTests.swift | 2 +- Tests/Tests/ViewTypes/TextEditorTests.swift | 2 +- Tests/Tests/ViewTypes/TextFieldTests.swift | 2 +- Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift | 2 +- Tests/Tests/ViewTypes/VideoPlayerTests.swift | 2 +- Tests/Tests/ViewTypes/ViewTests.swift | 2 +- Tests/Tests/ViewTypes/WebViewTests.swift | 2 +- Tests/Tests/ViewTypes/WindowTests.swift | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Tests/Tests/ViewTypes/ButtonTests.swift b/Tests/Tests/ViewTypes/ButtonTests.swift index 1c15314f..8053d2d6 100644 --- a/Tests/Tests/ViewTypes/ButtonTests.swift +++ b/Tests/Tests/ViewTypes/ButtonTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ButtonTests { #if canImport(AppKit) typealias PlatformButton = NSButton diff --git a/Tests/Tests/ViewTypes/ColorPickerTests.swift b/Tests/Tests/ViewTypes/ColorPickerTests.swift index c2da636c..ca8de4a3 100644 --- a/Tests/Tests/ViewTypes/ColorPickerTests.swift +++ b/Tests/Tests/ViewTypes/ColorPickerTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ColorPickerTests { #if canImport(UIKit) typealias PlatformColor = UIColor diff --git a/Tests/Tests/ViewTypes/DatePickerTests.swift b/Tests/Tests/ViewTypes/DatePickerTests.swift index e6b515a4..53137db0 100644 --- a/Tests/Tests/ViewTypes/DatePickerTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct DatePickerTests { #if canImport(UIKit) typealias PlatformDatePicker = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift index d1a9379a..8882fb72 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct DatePickerWithCompactStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithCompactStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift index 3cf6fff1..6e9b4ced 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct DatePickerWithFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithFieldStyle = NSDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift index 3034bfdc..0cb69cae 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct DatePickerWithGraphicalStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithGraphicalStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index 5837d954..c02f819a 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite struct DatePickerWithStepperFieldStyleTests { +@Suite(.serialized) struct DatePickerWithStepperFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker #endif diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index 30c4e524..dd95d7d2 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct DatePickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithWheelStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/FormTests.swift b/Tests/Tests/ViewTypes/FormTests.swift index 866b1110..939563ae 100644 --- a/Tests/Tests/ViewTypes/FormTests.swift +++ b/Tests/Tests/ViewTypes/FormTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct FormTests { #if canImport(UIKit) typealias PlatformForm = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift index 0e3ed041..e22f287e 100644 --- a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct FormWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformFormWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift index 421271f8..bf074b06 100644 --- a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift +++ b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct FullScreenCoverTests { @Test func introspect() async throws { try await introspection(of: UIPresentationController.self) { spy in diff --git a/Tests/Tests/ViewTypes/ListCellTests.swift b/Tests/Tests/ViewTypes/ListCellTests.swift index 4ccad641..dece5a70 100644 --- a/Tests/Tests/ViewTypes/ListCellTests.swift +++ b/Tests/Tests/ViewTypes/ListCellTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListCellTests { #if canImport(UIKit) typealias PlatformListCell = UIView // covers both UITableViewCell and UICollectionViewCell diff --git a/Tests/Tests/ViewTypes/ListTests.swift b/Tests/Tests/ViewTypes/ListTests.swift index e8cf9b37..484c851b 100644 --- a/Tests/Tests/ViewTypes/ListTests.swift +++ b/Tests/Tests/ViewTypes/ListTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListTests { #if canImport(UIKit) typealias PlatformList = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift index dd9603d5..396615ff 100644 --- a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithBorderedStyleTests { #if canImport(AppKit) typealias PlatformListWithBorderedStyle = NSTableView diff --git a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift index f7f3ec6b..71a63e3f 100644 --- a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index 882fa999..db7f46d9 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithInsetGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift index 0482416e..22a8353a 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithInsetStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift index 5b462575..3cf78d13 100644 --- a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithPlainStyleTests { #if canImport(UIKit) typealias PlatformListWithPlainStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift index 754cef04..64b2a964 100644 --- a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ListWithSidebarStyleTests { #if canImport(UIKit) typealias PlatformListWithSidebarStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/MapTests.swift b/Tests/Tests/ViewTypes/MapTests.swift index 9958a550..c516df51 100644 --- a/Tests/Tests/ViewTypes/MapTests.swift +++ b/Tests/Tests/ViewTypes/MapTests.swift @@ -5,7 +5,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite struct MapTests { +@Suite(.serialized) struct MapTests { typealias PlatformMap = MKMapView @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift index 5cbf7cac..cc4408ed 100644 --- a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift +++ b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct NavigationSplitViewTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationSplitView = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationStackTests.swift b/Tests/Tests/ViewTypes/NavigationStackTests.swift index 6dba62c9..dfce8263 100644 --- a/Tests/Tests/ViewTypes/NavigationStackTests.swift +++ b/Tests/Tests/ViewTypes/NavigationStackTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct NavigationStackTests { #if canImport(UIKit) typealias PlatformNavigationStack = UINavigationController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift index 8cb78860..a3fb37ee 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct NavigationViewWithColumnsStyleTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationViewWithColumnsStyle = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 32d1d188..546ff606 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct NavigationViewWithStackStyleTests { #if canImport(UIKit) typealias PlatformNavigationViewWithStackStyle = UINavigationController diff --git a/Tests/Tests/ViewTypes/PageControlTests.swift b/Tests/Tests/ViewTypes/PageControlTests.swift index 848df2ae..3ecc7963 100644 --- a/Tests/Tests/ViewTypes/PageControlTests.swift +++ b/Tests/Tests/ViewTypes/PageControlTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct PageControlTests { #if canImport(UIKit) typealias PlatformPageControl = UIPageControl diff --git a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift index a836a04e..caa51205 100644 --- a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct PickerWithMenuStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformPickerWithMenuStyle = NSPopUpButton diff --git a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift index c30fb140..9748d4c9 100644 --- a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct PickerWithSegmentedStyleTests { #if canImport(UIKit) typealias PlatformPickerWithSegmentedStyle = UISegmentedControl diff --git a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift index de1bfaa6..a53c5395 100644 --- a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct PickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformPickerWithWheelStyle = UIPickerView diff --git a/Tests/Tests/ViewTypes/PopoverTests.swift b/Tests/Tests/ViewTypes/PopoverTests.swift index d8af3704..2ae2fc95 100644 --- a/Tests/Tests/ViewTypes/PopoverTests.swift +++ b/Tests/Tests/ViewTypes/PopoverTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct PopoverTests { @Test func introspect() async throws { try await introspection(of: UIPopoverPresentationController.self) { spy in diff --git a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift index 571c89e4..64eaa2fb 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ProgressViewWithCircularStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithCircularStyle = UIActivityIndicatorView diff --git a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift index ce69a5e0..6fe6cda3 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ProgressViewWithLinearStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithLinearStyle = UIProgressView diff --git a/Tests/Tests/ViewTypes/ScrollViewTests.swift b/Tests/Tests/ViewTypes/ScrollViewTests.swift index 2059f9f2..2cb7d317 100644 --- a/Tests/Tests/ViewTypes/ScrollViewTests.swift +++ b/Tests/Tests/ViewTypes/ScrollViewTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ScrollViewTests { #if canImport(UIKit) typealias PlatformScrollView = UIScrollView diff --git a/Tests/Tests/ViewTypes/SecureFieldTests.swift b/Tests/Tests/ViewTypes/SecureFieldTests.swift index db5dc4d6..4a63feab 100644 --- a/Tests/Tests/ViewTypes/SecureFieldTests.swift +++ b/Tests/Tests/ViewTypes/SecureFieldTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct SecureFieldTests { #if canImport(UIKit) typealias PlatformSecureField = UITextField diff --git a/Tests/Tests/ViewTypes/SheetTests.swift b/Tests/Tests/ViewTypes/SheetTests.swift index 0cae40a6..7ee0e84e 100644 --- a/Tests/Tests/ViewTypes/SheetTests.swift +++ b/Tests/Tests/ViewTypes/SheetTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct SheetTests { #if os(iOS) @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/SliderTests.swift b/Tests/Tests/ViewTypes/SliderTests.swift index 7d12e6e2..e07f3a43 100644 --- a/Tests/Tests/ViewTypes/SliderTests.swift +++ b/Tests/Tests/ViewTypes/SliderTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct SliderTests { #if canImport(UIKit) typealias PlatformSlider = UISlider diff --git a/Tests/Tests/ViewTypes/StepperTests.swift b/Tests/Tests/ViewTypes/StepperTests.swift index ee3a89c8..6ccb6b6c 100644 --- a/Tests/Tests/ViewTypes/StepperTests.swift +++ b/Tests/Tests/ViewTypes/StepperTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct StepperTests { #if canImport(UIKit) typealias PlatformStepper = UIStepper diff --git a/Tests/Tests/ViewTypes/TabViewTests.swift b/Tests/Tests/ViewTypes/TabViewTests.swift index 0b520eb2..0df798e5 100644 --- a/Tests/Tests/ViewTypes/TabViewTests.swift +++ b/Tests/Tests/ViewTypes/TabViewTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TabViewTests { #if canImport(UIKit) typealias PlatformTabView = UITabBarController diff --git a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift index e63bdf11..e25a292a 100644 --- a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift +++ b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TabViewWithPageStyleTests { #if canImport(UIKit) typealias PlatformTabViewWithPageStyle = UICollectionView diff --git a/Tests/Tests/ViewTypes/TableTests.swift b/Tests/Tests/ViewTypes/TableTests.swift index 23466983..fc246b05 100644 --- a/Tests/Tests/ViewTypes/TableTests.swift +++ b/Tests/Tests/ViewTypes/TableTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TableTests { #if canImport(UIKit) typealias PlatformTable = UICollectionView diff --git a/Tests/Tests/ViewTypes/TextEditorTests.swift b/Tests/Tests/ViewTypes/TextEditorTests.swift index 8c32a347..0302bc68 100644 --- a/Tests/Tests/ViewTypes/TextEditorTests.swift +++ b/Tests/Tests/ViewTypes/TextEditorTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TextEditorTests { #if canImport(UIKit) typealias PlatformTextEditor = UITextView diff --git a/Tests/Tests/ViewTypes/TextFieldTests.swift b/Tests/Tests/ViewTypes/TextFieldTests.swift index 169c6573..ba09e320 100644 --- a/Tests/Tests/ViewTypes/TextFieldTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TextFieldTests { #if canImport(UIKit) typealias PlatformTextField = UITextField diff --git a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift index c8078d4f..5471e9d6 100644 --- a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct TextFieldWithVerticalAxisTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformTextField = UITextView diff --git a/Tests/Tests/ViewTypes/ToggleTests.swift b/Tests/Tests/ViewTypes/ToggleTests.swift index c27dd0ca..1096361a 100644 --- a/Tests/Tests/ViewTypes/ToggleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ToggleTests { #if canImport(UIKit) typealias PlatformToggle = UISwitch diff --git a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift index 2d64afbb..4a3883d3 100644 --- a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ToggleWithButtonStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithButtonStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index e62edfb0..702a50c6 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ToggleWithCheckboxStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithCheckboxStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift index bfd0365e..c61efda5 100644 --- a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct ToggleWithSwitchStyleTests { #if canImport(UIKit) typealias PlatformToggleWithSwitchStyle = UISwitch diff --git a/Tests/Tests/ViewTypes/VideoPlayerTests.swift b/Tests/Tests/ViewTypes/VideoPlayerTests.swift index 552e0a7b..799a8d38 100644 --- a/Tests/Tests/ViewTypes/VideoPlayerTests.swift +++ b/Tests/Tests/ViewTypes/VideoPlayerTests.swift @@ -5,7 +5,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct VideoPlayerTests { #if canImport(UIKit) typealias PlatformVideoPlayer = AVPlayerViewController diff --git a/Tests/Tests/ViewTypes/ViewTests.swift b/Tests/Tests/ViewTypes/ViewTests.swift index 12e425e6..9ecdc003 100644 --- a/Tests/Tests/ViewTypes/ViewTests.swift +++ b/Tests/Tests/ViewTypes/ViewTests.swift @@ -3,7 +3,7 @@ import SwiftUI import Testing @MainActor -@Suite +@Suite(.serialized) struct ViewTests { @Test func introspect() async throws { let (entity1, entity2) = try await introspection(of: PlatformView.self) { spy1, spy2 in diff --git a/Tests/Tests/ViewTypes/WebViewTests.swift b/Tests/Tests/ViewTypes/WebViewTests.swift index dc7a1127..604f378d 100644 --- a/Tests/Tests/ViewTypes/WebViewTests.swift +++ b/Tests/Tests/ViewTypes/WebViewTests.swift @@ -5,7 +5,7 @@ import Testing import WebKit @MainActor -@Suite +@Suite(.serialized) struct WebViewTests { @available(iOS 26, tvOS 26, macOS 26, visionOS 26, *) @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/WindowTests.swift b/Tests/Tests/ViewTypes/WindowTests.swift index 7bb18c97..2cd8a4c8 100644 --- a/Tests/Tests/ViewTypes/WindowTests.swift +++ b/Tests/Tests/ViewTypes/WindowTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite +@Suite(.serialized) struct WindowTests { #if canImport(UIKit) typealias PlatformWindow = UIWindow From f5c1e92dfeae0970f50604b3e152be065327aea0 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:01:36 +0100 Subject: [PATCH 53/73] WIP --- .../xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme index ae540df3..e79e1d06 100644 --- a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme +++ b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectTests.xcscheme @@ -29,7 +29,8 @@ shouldUseLaunchSchemeArgsEnv = "YES"> + skipped = "NO" + parallelizable = "NO"> Date: Wed, 9 Jul 2025 20:04:17 +0100 Subject: [PATCH 54/73] WIP --- .../Tests/ViewTypes/ViewControllerTests.swift | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Tests/Tests/ViewTypes/ViewControllerTests.swift b/Tests/Tests/ViewTypes/ViewControllerTests.swift index eae5de8f..78c27960 100644 --- a/Tests/Tests/ViewTypes/ViewControllerTests.swift +++ b/Tests/Tests/ViewTypes/ViewControllerTests.swift @@ -1,23 +1,20 @@ #if !os(macOS) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing @MainActor -final class ViewControllerTests: XCTestCase { - func testViewController() { - XCTAssertViewIntrospection(of: PlatformViewController.self) { spies in - let spy0 = spies[0] - let spy1 = spies[1] - let spy2 = spies[2] - +@Suite +struct ViewControllerTests { + @Test func introspect() async throws { + let (entity1, entity2, entity3) = try await introspection(of: PlatformViewController.self) { spy1, spy2, spy3 in TabView { NavigationView { Text("Root").frame(maxWidth: .infinity, maxHeight: .infinity).background(Color.red) .introspect( .viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), - customize: spy2 + customize: spy3 ) } .navigationViewStyle(.stack) @@ -28,22 +25,21 @@ final class ViewControllerTests: XCTestCase { .introspect( .viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), - customize: spy1 + customize: spy2 ) } .introspect( .viewController, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2, .v26), - customize: spy0 + customize: spy1 ) - } extraAssertions: { - #if !os(visionOS) - XCTAssert($0[safe: 0] is UITabBarController) - #endif - XCTAssert($0[safe: 1] is UINavigationController) - XCTAssert(String(describing: $0[safe: 2]).contains("UIHostingController")) - XCTAssert($0[safe: 1] === $0[safe: 2]?.parent) } + #if !os(visionOS) + #expect(entity1 is UITabBarController) + #endif + #expect(entity2 is UINavigationController) + #expect(String(describing: entity3).contains("UIHostingController")) + #expect(entity2 === entity3.parent) } } #endif From 2e93caa64b0330b50d9569aae2a7038ecfed23aa Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:04:37 +0100 Subject: [PATCH 55/73] WIP --- Tests/Tests/ViewTypes/ButtonTests.swift | 2 +- Tests/Tests/ViewTypes/ColorPickerTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerTests.swift | 2 +- .../Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift | 2 +- .../Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift | 2 +- Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift | 2 +- Tests/Tests/ViewTypes/FormTests.swift | 2 +- Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/FullScreenCoverTests.swift | 2 +- Tests/Tests/ViewTypes/ListCellTests.swift | 2 +- Tests/Tests/ViewTypes/ListTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift | 2 +- Tests/Tests/ViewTypes/MapTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationSplitViewTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationStackTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift | 2 +- Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PageControlTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift | 2 +- Tests/Tests/ViewTypes/PopoverTests.swift | 2 +- Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ScrollViewTests.swift | 2 +- Tests/Tests/ViewTypes/SecureFieldTests.swift | 2 +- Tests/Tests/ViewTypes/SheetTests.swift | 2 +- Tests/Tests/ViewTypes/SliderTests.swift | 2 +- Tests/Tests/ViewTypes/StepperTests.swift | 2 +- Tests/Tests/ViewTypes/TabViewTests.swift | 2 +- Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift | 2 +- Tests/Tests/ViewTypes/TableTests.swift | 2 +- Tests/Tests/ViewTypes/TextEditorTests.swift | 2 +- Tests/Tests/ViewTypes/TextFieldTests.swift | 2 +- Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift | 2 +- Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift | 2 +- Tests/Tests/ViewTypes/VideoPlayerTests.swift | 2 +- Tests/Tests/ViewTypes/ViewTests.swift | 2 +- Tests/Tests/ViewTypes/WebViewTests.swift | 2 +- Tests/Tests/ViewTypes/WindowTests.swift | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Tests/Tests/ViewTypes/ButtonTests.swift b/Tests/Tests/ViewTypes/ButtonTests.swift index 8053d2d6..1c15314f 100644 --- a/Tests/Tests/ViewTypes/ButtonTests.swift +++ b/Tests/Tests/ViewTypes/ButtonTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ButtonTests { #if canImport(AppKit) typealias PlatformButton = NSButton diff --git a/Tests/Tests/ViewTypes/ColorPickerTests.swift b/Tests/Tests/ViewTypes/ColorPickerTests.swift index ca8de4a3..c2da636c 100644 --- a/Tests/Tests/ViewTypes/ColorPickerTests.swift +++ b/Tests/Tests/ViewTypes/ColorPickerTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ColorPickerTests { #if canImport(UIKit) typealias PlatformColor = UIColor diff --git a/Tests/Tests/ViewTypes/DatePickerTests.swift b/Tests/Tests/ViewTypes/DatePickerTests.swift index 53137db0..e6b515a4 100644 --- a/Tests/Tests/ViewTypes/DatePickerTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct DatePickerTests { #if canImport(UIKit) typealias PlatformDatePicker = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift index 8882fb72..d1a9379a 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct DatePickerWithCompactStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithCompactStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift index 6e9b4ced..3cf6fff1 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct DatePickerWithFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithFieldStyle = NSDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift index 0cb69cae..3034bfdc 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithGraphicalStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct DatePickerWithGraphicalStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithGraphicalStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index c02f819a..5837d954 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) struct DatePickerWithStepperFieldStyleTests { +@Suite struct DatePickerWithStepperFieldStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformDatePickerWithStepperFieldStyle = NSDatePicker #endif diff --git a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift index dd95d7d2..30c4e524 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithWheelStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct DatePickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformDatePickerWithWheelStyle = UIDatePicker diff --git a/Tests/Tests/ViewTypes/FormTests.swift b/Tests/Tests/ViewTypes/FormTests.swift index 939563ae..866b1110 100644 --- a/Tests/Tests/ViewTypes/FormTests.swift +++ b/Tests/Tests/ViewTypes/FormTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct FormTests { #if canImport(UIKit) typealias PlatformForm = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift index e22f287e..0e3ed041 100644 --- a/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/FormWithGroupedStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct FormWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformFormWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift index bf074b06..421271f8 100644 --- a/Tests/Tests/ViewTypes/FullScreenCoverTests.swift +++ b/Tests/Tests/ViewTypes/FullScreenCoverTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct FullScreenCoverTests { @Test func introspect() async throws { try await introspection(of: UIPresentationController.self) { spy in diff --git a/Tests/Tests/ViewTypes/ListCellTests.swift b/Tests/Tests/ViewTypes/ListCellTests.swift index dece5a70..4ccad641 100644 --- a/Tests/Tests/ViewTypes/ListCellTests.swift +++ b/Tests/Tests/ViewTypes/ListCellTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListCellTests { #if canImport(UIKit) typealias PlatformListCell = UIView // covers both UITableViewCell and UICollectionViewCell diff --git a/Tests/Tests/ViewTypes/ListTests.swift b/Tests/Tests/ViewTypes/ListTests.swift index 484c851b..e8cf9b37 100644 --- a/Tests/Tests/ViewTypes/ListTests.swift +++ b/Tests/Tests/ViewTypes/ListTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListTests { #if canImport(UIKit) typealias PlatformList = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift index 396615ff..dd9603d5 100644 --- a/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithBorderedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithBorderedStyleTests { #if canImport(AppKit) typealias PlatformListWithBorderedStyle = NSTableView diff --git a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift index 71a63e3f..f7f3ec6b 100644 --- a/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithGroupedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index db7f46d9..882fa999 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithInsetGroupedStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift index 22a8353a..0482416e 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithInsetStyleTests { #if canImport(UIKit) typealias PlatformListWithInsetStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift index 3cf78d13..5b462575 100644 --- a/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithPlainStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithPlainStyleTests { #if canImport(UIKit) typealias PlatformListWithPlainStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift index 64b2a964..754cef04 100644 --- a/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithSidebarStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ListWithSidebarStyleTests { #if canImport(UIKit) typealias PlatformListWithSidebarStyle = UIScrollView // covers both UITableView and UICollectionView diff --git a/Tests/Tests/ViewTypes/MapTests.swift b/Tests/Tests/ViewTypes/MapTests.swift index c516df51..9958a550 100644 --- a/Tests/Tests/ViewTypes/MapTests.swift +++ b/Tests/Tests/ViewTypes/MapTests.swift @@ -5,7 +5,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) struct MapTests { +@Suite struct MapTests { typealias PlatformMap = MKMapView @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift index cc4408ed..5cbf7cac 100644 --- a/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift +++ b/Tests/Tests/ViewTypes/NavigationSplitViewTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct NavigationSplitViewTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationSplitView = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationStackTests.swift b/Tests/Tests/ViewTypes/NavigationStackTests.swift index dfce8263..6dba62c9 100644 --- a/Tests/Tests/ViewTypes/NavigationStackTests.swift +++ b/Tests/Tests/ViewTypes/NavigationStackTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct NavigationStackTests { #if canImport(UIKit) typealias PlatformNavigationStack = UINavigationController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift index a3fb37ee..8cb78860 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithColumnsStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct NavigationViewWithColumnsStyleTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformNavigationViewWithColumnsStyle = UISplitViewController diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 546ff606..32d1d188 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct NavigationViewWithStackStyleTests { #if canImport(UIKit) typealias PlatformNavigationViewWithStackStyle = UINavigationController diff --git a/Tests/Tests/ViewTypes/PageControlTests.swift b/Tests/Tests/ViewTypes/PageControlTests.swift index 3ecc7963..848df2ae 100644 --- a/Tests/Tests/ViewTypes/PageControlTests.swift +++ b/Tests/Tests/ViewTypes/PageControlTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct PageControlTests { #if canImport(UIKit) typealias PlatformPageControl = UIPageControl diff --git a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift index caa51205..a836a04e 100644 --- a/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithMenuStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct PickerWithMenuStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformPickerWithMenuStyle = NSPopUpButton diff --git a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift index 9748d4c9..c30fb140 100644 --- a/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithSegmentedStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct PickerWithSegmentedStyleTests { #if canImport(UIKit) typealias PlatformPickerWithSegmentedStyle = UISegmentedControl diff --git a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift index a53c5395..de1bfaa6 100644 --- a/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift +++ b/Tests/Tests/ViewTypes/PickerWithWheelStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct PickerWithWheelStyleTests { #if canImport(UIKit) typealias PlatformPickerWithWheelStyle = UIPickerView diff --git a/Tests/Tests/ViewTypes/PopoverTests.swift b/Tests/Tests/ViewTypes/PopoverTests.swift index 2ae2fc95..d8af3704 100644 --- a/Tests/Tests/ViewTypes/PopoverTests.swift +++ b/Tests/Tests/ViewTypes/PopoverTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct PopoverTests { @Test func introspect() async throws { try await introspection(of: UIPopoverPresentationController.self) { spy in diff --git a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift index 64eaa2fb..571c89e4 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithCircularStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ProgressViewWithCircularStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithCircularStyle = UIActivityIndicatorView diff --git a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift index 6fe6cda3..ce69a5e0 100644 --- a/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift +++ b/Tests/Tests/ViewTypes/ProgressViewWithLinearStyleTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ProgressViewWithLinearStyleTests { #if canImport(UIKit) typealias PlatformProgressViewWithLinearStyle = UIProgressView diff --git a/Tests/Tests/ViewTypes/ScrollViewTests.swift b/Tests/Tests/ViewTypes/ScrollViewTests.swift index 2cb7d317..2059f9f2 100644 --- a/Tests/Tests/ViewTypes/ScrollViewTests.swift +++ b/Tests/Tests/ViewTypes/ScrollViewTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ScrollViewTests { #if canImport(UIKit) typealias PlatformScrollView = UIScrollView diff --git a/Tests/Tests/ViewTypes/SecureFieldTests.swift b/Tests/Tests/ViewTypes/SecureFieldTests.swift index 4a63feab..db5dc4d6 100644 --- a/Tests/Tests/ViewTypes/SecureFieldTests.swift +++ b/Tests/Tests/ViewTypes/SecureFieldTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct SecureFieldTests { #if canImport(UIKit) typealias PlatformSecureField = UITextField diff --git a/Tests/Tests/ViewTypes/SheetTests.swift b/Tests/Tests/ViewTypes/SheetTests.swift index 7ee0e84e..0cae40a6 100644 --- a/Tests/Tests/ViewTypes/SheetTests.swift +++ b/Tests/Tests/ViewTypes/SheetTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct SheetTests { #if os(iOS) @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/SliderTests.swift b/Tests/Tests/ViewTypes/SliderTests.swift index e07f3a43..7d12e6e2 100644 --- a/Tests/Tests/ViewTypes/SliderTests.swift +++ b/Tests/Tests/ViewTypes/SliderTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct SliderTests { #if canImport(UIKit) typealias PlatformSlider = UISlider diff --git a/Tests/Tests/ViewTypes/StepperTests.swift b/Tests/Tests/ViewTypes/StepperTests.swift index 6ccb6b6c..ee3a89c8 100644 --- a/Tests/Tests/ViewTypes/StepperTests.swift +++ b/Tests/Tests/ViewTypes/StepperTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct StepperTests { #if canImport(UIKit) typealias PlatformStepper = UIStepper diff --git a/Tests/Tests/ViewTypes/TabViewTests.swift b/Tests/Tests/ViewTypes/TabViewTests.swift index 0df798e5..0b520eb2 100644 --- a/Tests/Tests/ViewTypes/TabViewTests.swift +++ b/Tests/Tests/ViewTypes/TabViewTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TabViewTests { #if canImport(UIKit) typealias PlatformTabView = UITabBarController diff --git a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift index e25a292a..e63bdf11 100644 --- a/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift +++ b/Tests/Tests/ViewTypes/TabViewWithPageStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TabViewWithPageStyleTests { #if canImport(UIKit) typealias PlatformTabViewWithPageStyle = UICollectionView diff --git a/Tests/Tests/ViewTypes/TableTests.swift b/Tests/Tests/ViewTypes/TableTests.swift index fc246b05..23466983 100644 --- a/Tests/Tests/ViewTypes/TableTests.swift +++ b/Tests/Tests/ViewTypes/TableTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TableTests { #if canImport(UIKit) typealias PlatformTable = UICollectionView diff --git a/Tests/Tests/ViewTypes/TextEditorTests.swift b/Tests/Tests/ViewTypes/TextEditorTests.swift index 0302bc68..8c32a347 100644 --- a/Tests/Tests/ViewTypes/TextEditorTests.swift +++ b/Tests/Tests/ViewTypes/TextEditorTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TextEditorTests { #if canImport(UIKit) typealias PlatformTextEditor = UITextView diff --git a/Tests/Tests/ViewTypes/TextFieldTests.swift b/Tests/Tests/ViewTypes/TextFieldTests.swift index ba09e320..169c6573 100644 --- a/Tests/Tests/ViewTypes/TextFieldTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TextFieldTests { #if canImport(UIKit) typealias PlatformTextField = UITextField diff --git a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift index 5471e9d6..c8078d4f 100644 --- a/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift +++ b/Tests/Tests/ViewTypes/TextFieldWithVerticalAxisTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct TextFieldWithVerticalAxisTests { #if canImport(UIKit) && (os(iOS) || os(visionOS)) typealias PlatformTextField = UITextView diff --git a/Tests/Tests/ViewTypes/ToggleTests.swift b/Tests/Tests/ViewTypes/ToggleTests.swift index 1096361a..c27dd0ca 100644 --- a/Tests/Tests/ViewTypes/ToggleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ToggleTests { #if canImport(UIKit) typealias PlatformToggle = UISwitch diff --git a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift index 4a3883d3..2d64afbb 100644 --- a/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithButtonStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ToggleWithButtonStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithButtonStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index 702a50c6..e62edfb0 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ToggleWithCheckboxStyleTests { #if canImport(AppKit) && !targetEnvironment(macCatalyst) typealias PlatformToggleWithCheckboxStyle = NSButton diff --git a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift index c61efda5..bfd0365e 100644 --- a/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithSwitchStyleTests.swift @@ -4,7 +4,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct ToggleWithSwitchStyleTests { #if canImport(UIKit) typealias PlatformToggleWithSwitchStyle = UISwitch diff --git a/Tests/Tests/ViewTypes/VideoPlayerTests.swift b/Tests/Tests/ViewTypes/VideoPlayerTests.swift index 799a8d38..552e0a7b 100644 --- a/Tests/Tests/ViewTypes/VideoPlayerTests.swift +++ b/Tests/Tests/ViewTypes/VideoPlayerTests.swift @@ -5,7 +5,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct VideoPlayerTests { #if canImport(UIKit) typealias PlatformVideoPlayer = AVPlayerViewController diff --git a/Tests/Tests/ViewTypes/ViewTests.swift b/Tests/Tests/ViewTypes/ViewTests.swift index 9ecdc003..12e425e6 100644 --- a/Tests/Tests/ViewTypes/ViewTests.swift +++ b/Tests/Tests/ViewTypes/ViewTests.swift @@ -3,7 +3,7 @@ import SwiftUI import Testing @MainActor -@Suite(.serialized) +@Suite struct ViewTests { @Test func introspect() async throws { let (entity1, entity2) = try await introspection(of: PlatformView.self) { spy1, spy2 in diff --git a/Tests/Tests/ViewTypes/WebViewTests.swift b/Tests/Tests/ViewTypes/WebViewTests.swift index 604f378d..dc7a1127 100644 --- a/Tests/Tests/ViewTypes/WebViewTests.swift +++ b/Tests/Tests/ViewTypes/WebViewTests.swift @@ -5,7 +5,7 @@ import Testing import WebKit @MainActor -@Suite(.serialized) +@Suite struct WebViewTests { @available(iOS 26, tvOS 26, macOS 26, visionOS 26, *) @Test func introspect() async throws { diff --git a/Tests/Tests/ViewTypes/WindowTests.swift b/Tests/Tests/ViewTypes/WindowTests.swift index 2cd8a4c8..7bb18c97 100644 --- a/Tests/Tests/ViewTypes/WindowTests.swift +++ b/Tests/Tests/ViewTypes/WindowTests.swift @@ -3,7 +3,7 @@ import SwiftUIIntrospect import Testing @MainActor -@Suite(.serialized) +@Suite struct WindowTests { #if canImport(UIKit) typealias PlatformWindow = UIWindow From 2ac0f85e5f3e6430d3fa322035d71ab989a6281c Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:07:37 +0100 Subject: [PATCH 56/73] WIP --- .../ViewTypes/DatePickerWithStepperFieldStyleTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift index 5837d954..e644b2fa 100644 --- a/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift +++ b/Tests/Tests/ViewTypes/DatePickerWithStepperFieldStyleTests.swift @@ -39,8 +39,8 @@ import Testing } #if canImport(AppKit) && !targetEnvironment(macCatalyst) #expect(entity1.dateValue == date1) - #expect(entity2.dateValue == date3) - #expect(entity3.dateValue == date2) + #expect(entity2.dateValue == date2) + #expect(entity3.dateValue == date3) #endif } } From b9313eaad56c4b31bd02e6ad87067454e68cf873 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:11:34 +0100 Subject: [PATCH 57/73] WIP --- Tests/Tests/ViewTypes/SearchFieldTests.swift | 54 ++++++-------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/Tests/Tests/ViewTypes/SearchFieldTests.swift b/Tests/Tests/ViewTypes/SearchFieldTests.swift index e48995c1..a729ec93 100644 --- a/Tests/Tests/ViewTypes/SearchFieldTests.swift +++ b/Tests/Tests/ViewTypes/SearchFieldTests.swift @@ -1,23 +1,18 @@ #if !os(macOS) && !targetEnvironment(macCatalyst) import SwiftUI import SwiftUIIntrospect -import XCTest +import Testing -@available(iOS 15, tvOS 15, *) @MainActor -final class SearchFieldTests: XCTestCase { +@Suite +struct SearchFieldTests { #if canImport(UIKit) typealias PlatformSearchField = UISearchBar #endif - func testSearchFieldInNavigationStack() throws { - guard #available(iOS 15, tvOS 15, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformSearchField.self) { spies in - let spy = spies[0] - + @available(iOS 15, tvOS 15, *) + @Test func introspectInNavigationStack() async throws { + try await introspection(of: PlatformSearchField.self) { spy in NavigationView { Text("Customized") .searchable(text: .constant("")) @@ -29,14 +24,9 @@ final class SearchFieldTests: XCTestCase { } } - func testSearchFieldInNavigationStackAsAncestor() throws { - guard #available(iOS 15, tvOS 15, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformSearchField.self) { spies in - let spy = spies[0] - + @available(iOS 15, tvOS 15, *) + @Test func introspectInNavigationStackAsAncestor() async throws { + try await introspection(of: PlatformSearchField.self) { spy in NavigationView { Text("Customized") .searchable(text: .constant("")) @@ -48,17 +38,10 @@ final class SearchFieldTests: XCTestCase { } } - func testSearchFieldInNavigationSplitView() throws { - guard #available(iOS 15, tvOS 15, *) else { - throw XCTSkip() - } - guard #unavailable(visionOS 26) else { // TODO: verify this - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformSearchField.self) { spies in - let spy = spies[0] - + @available(iOS 15, tvOS 15, *) + @available(visionOS, introduced: 1, obsoleted: 26) + @Test func introspectInNavigationSplitView() async throws { + try await introspection(of: PlatformSearchField.self) { spy in NavigationView { Text("Customized") .searchable(text: .constant("")) @@ -76,14 +59,9 @@ final class SearchFieldTests: XCTestCase { } } - func testSearchFieldInNavigationSplitViewAsAncestor() throws { - guard #available(iOS 15, tvOS 15, *) else { - throw XCTSkip() - } - - XCTAssertViewIntrospection(of: PlatformSearchField.self) { spies in - let spy = spies[0] - + @available(iOS 15, tvOS 15, *) + @Test func introspectInNavigationSplitViewAsAncestor() async throws { + try await introspection(of: PlatformSearchField.self) { spy in NavigationView { Text("Customized") .searchable(text: .constant("")) From 5ed6f177e92ffe9c4b16c44b3d3efb6ee58e5078 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:16:15 +0100 Subject: [PATCH 58/73] WIP --- Tests/Tests/PlatformVersionTests.swift | 671 +++++++++++++------------ 1 file changed, 336 insertions(+), 335 deletions(-) diff --git a/Tests/Tests/PlatformVersionTests.swift b/Tests/Tests/PlatformVersionTests.swift index fcd4cf8e..6f26ab71 100644 --- a/Tests/Tests/PlatformVersionTests.swift +++ b/Tests/Tests/PlatformVersionTests.swift @@ -1,433 +1,434 @@ @_spi(Internals) import SwiftUIIntrospect -import XCTest +import Testing -final class PlatformVersionTests: XCTestCase { - func test_iOS_isCurrent() { +@Suite +struct PlatformVersionTests { + @Test func iOS_isCurrent() { #if os(iOS) if #available(iOS 26, *) { - XCTAssertEqual(iOSVersion.v26.isCurrent, true) - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v26.isCurrent == true) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 18, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, true) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v18.isCurrent == true) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 17, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, true) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == true) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 16, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, true) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == true) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 15, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, true) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == true) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 14, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, true) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == true) + #expect(iOSVersion.v13.isCurrent == false) } else if #available(iOS 13, *) { - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, true) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == true) } #else - XCTAssertEqual(iOSVersion.v26.isCurrent, false) - XCTAssertEqual(iOSVersion.v18.isCurrent, false) - XCTAssertEqual(iOSVersion.v17.isCurrent, false) - XCTAssertEqual(iOSVersion.v16.isCurrent, false) - XCTAssertEqual(iOSVersion.v15.isCurrent, false) - XCTAssertEqual(iOSVersion.v14.isCurrent, false) - XCTAssertEqual(iOSVersion.v13.isCurrent, false) + #expect(iOSVersion.v26.isCurrent == false) + #expect(iOSVersion.v18.isCurrent == false) + #expect(iOSVersion.v17.isCurrent == false) + #expect(iOSVersion.v16.isCurrent == false) + #expect(iOSVersion.v15.isCurrent == false) + #expect(iOSVersion.v14.isCurrent == false) + #expect(iOSVersion.v13.isCurrent == false) #endif } - func test_iOS_isCurrentOrPast() { + @Test func iOS_isCurrentOrPast() { #if os(iOS) if #available(iOS 26, *) { - XCTAssertEqual(iOSVersion.v26.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v26.isCurrentOrPast == true) + #expect(iOSVersion.v18.isCurrentOrPast == true) + #expect(iOSVersion.v17.isCurrentOrPast == true) + #expect(iOSVersion.v16.isCurrentOrPast == true) + #expect(iOSVersion.v15.isCurrentOrPast == true) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 18, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == true) + #expect(iOSVersion.v17.isCurrentOrPast == true) + #expect(iOSVersion.v16.isCurrentOrPast == true) + #expect(iOSVersion.v15.isCurrentOrPast == true) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 17, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == true) + #expect(iOSVersion.v16.isCurrentOrPast == true) + #expect(iOSVersion.v15.isCurrentOrPast == true) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 16, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == false) + #expect(iOSVersion.v16.isCurrentOrPast == true) + #expect(iOSVersion.v15.isCurrentOrPast == true) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 15, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == false) + #expect(iOSVersion.v16.isCurrentOrPast == false) + #expect(iOSVersion.v15.isCurrentOrPast == true) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 14, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == false) + #expect(iOSVersion.v16.isCurrentOrPast == false) + #expect(iOSVersion.v15.isCurrentOrPast == false) + #expect(iOSVersion.v14.isCurrentOrPast == true) + #expect(iOSVersion.v13.isCurrentOrPast == true) } else if #available(iOS 13, *) { - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, true) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == false) + #expect(iOSVersion.v16.isCurrentOrPast == false) + #expect(iOSVersion.v15.isCurrentOrPast == false) + #expect(iOSVersion.v14.isCurrentOrPast == false) + #expect(iOSVersion.v13.isCurrentOrPast == true) } #else - XCTAssertEqual(iOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(iOSVersion.v13.isCurrentOrPast, false) + #expect(iOSVersion.v26.isCurrentOrPast == false) + #expect(iOSVersion.v18.isCurrentOrPast == false) + #expect(iOSVersion.v17.isCurrentOrPast == false) + #expect(iOSVersion.v16.isCurrentOrPast == false) + #expect(iOSVersion.v15.isCurrentOrPast == false) + #expect(iOSVersion.v14.isCurrentOrPast == false) + #expect(iOSVersion.v13.isCurrentOrPast == false) #endif } - func test_macOS_isCurrent() { + @Test func macOS_isCurrent() { #if os(macOS) if #available(macOS 26, *) { - XCTAssertEqual(macOSVersion.v26.isCurrent, true) - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v26.isCurrent == true) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 15, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, true) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v15.isCurrent == true) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 14, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, true) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == true) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 13, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, true) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == true) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 12, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, true) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == true) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 11, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == true) + #expect(macOSVersion.v10_15.isCurrent == false) } else if #available(macOS 10.15, *) { - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, true) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == true) } #else - XCTAssertEqual(macOSVersion.v26.isCurrent, false) - XCTAssertEqual(macOSVersion.v15.isCurrent, false) - XCTAssertEqual(macOSVersion.v14.isCurrent, false) - XCTAssertEqual(macOSVersion.v13.isCurrent, false) - XCTAssertEqual(macOSVersion.v12.isCurrent, false) - XCTAssertEqual(macOSVersion.v11.isCurrent, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrent, false) + #expect(macOSVersion.v26.isCurrent == false) + #expect(macOSVersion.v15.isCurrent == false) + #expect(macOSVersion.v14.isCurrent == false) + #expect(macOSVersion.v13.isCurrent == false) + #expect(macOSVersion.v12.isCurrent == false) + #expect(macOSVersion.v11.isCurrent == false) + #expect(macOSVersion.v10_15.isCurrent == false) #endif } - func test_macOS_isCurrentOrPast() { + @Test func macOS_isCurrentOrPast() { #if os(macOS) if #available(macOS 26, *) { - XCTAssertEqual(macOSVersion.v26.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v26.isCurrentOrPast == true) + #expect(macOSVersion.v15.isCurrentOrPast == true) + #expect(macOSVersion.v14.isCurrentOrPast == true) + #expect(macOSVersion.v13.isCurrentOrPast == true) + #expect(macOSVersion.v12.isCurrentOrPast == true) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 15, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == true) + #expect(macOSVersion.v14.isCurrentOrPast == true) + #expect(macOSVersion.v13.isCurrentOrPast == true) + #expect(macOSVersion.v12.isCurrentOrPast == true) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 14, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == true) + #expect(macOSVersion.v13.isCurrentOrPast == true) + #expect(macOSVersion.v12.isCurrentOrPast == true) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 13, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == false) + #expect(macOSVersion.v13.isCurrentOrPast == true) + #expect(macOSVersion.v12.isCurrentOrPast == true) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 12, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == false) + #expect(macOSVersion.v13.isCurrentOrPast == false) + #expect(macOSVersion.v12.isCurrentOrPast == true) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 11, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, true) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == false) + #expect(macOSVersion.v13.isCurrentOrPast == false) + #expect(macOSVersion.v12.isCurrentOrPast == false) + #expect(macOSVersion.v11.isCurrentOrPast == true) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } else if #available(macOS 10.15, *) { - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, true) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == false) + #expect(macOSVersion.v13.isCurrentOrPast == false) + #expect(macOSVersion.v12.isCurrentOrPast == false) + #expect(macOSVersion.v11.isCurrentOrPast == false) + #expect(macOSVersion.v10_15.isCurrentOrPast == true) } #else - XCTAssertEqual(macOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v13.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v12.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v11.isCurrentOrPast, false) - XCTAssertEqual(macOSVersion.v10_15.isCurrentOrPast, false) + #expect(macOSVersion.v26.isCurrentOrPast == false) + #expect(macOSVersion.v15.isCurrentOrPast == false) + #expect(macOSVersion.v14.isCurrentOrPast == false) + #expect(macOSVersion.v13.isCurrentOrPast == false) + #expect(macOSVersion.v12.isCurrentOrPast == false) + #expect(macOSVersion.v11.isCurrentOrPast == false) + #expect(macOSVersion.v10_15.isCurrentOrPast == false) #endif } - func test_tvOS_isCurrent() { + @Test func tvOS_isCurrent() { #if os(tvOS) if #available(tvOS 26, *) { - XCTAssertEqual(tvOSVersion.v26.isCurrent, true) - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v26.isCurrent == true) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 18, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, true) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v18.isCurrent == true) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 17, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, true) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == true) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 16, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, true) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == true) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 15, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, true) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == true) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 14, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, true) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == true) + #expect(tvOSVersion.v13.isCurrent == false) } else if #available(tvOS 13, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, true) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == true) } #else - XCTAssertEqual(tvOSVersion.v26.isCurrent, false) - XCTAssertEqual(tvOSVersion.v18.isCurrent, false) - XCTAssertEqual(tvOSVersion.v17.isCurrent, false) - XCTAssertEqual(tvOSVersion.v16.isCurrent, false) - XCTAssertEqual(tvOSVersion.v15.isCurrent, false) - XCTAssertEqual(tvOSVersion.v14.isCurrent, false) - XCTAssertEqual(tvOSVersion.v13.isCurrent, false) + #expect(tvOSVersion.v26.isCurrent == false) + #expect(tvOSVersion.v18.isCurrent == false) + #expect(tvOSVersion.v17.isCurrent == false) + #expect(tvOSVersion.v16.isCurrent == false) + #expect(tvOSVersion.v15.isCurrent == false) + #expect(tvOSVersion.v14.isCurrent == false) + #expect(tvOSVersion.v13.isCurrent == false) #endif } - func test_tvOS_isCurrentOrPast() { + @Test func tvOS_isCurrentOrPast() { #if os(tvOS) if #available(tvOS 26, *) { - XCTAssertEqual(tvOSVersion.v26.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v26.isCurrentOrPast == true) + #expect(tvOSVersion.v18.isCurrentOrPast == true) + #expect(tvOSVersion.v17.isCurrentOrPast == true) + #expect(tvOSVersion.v16.isCurrentOrPast == true) + #expect(tvOSVersion.v15.isCurrentOrPast == true) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 18, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == true) + #expect(tvOSVersion.v17.isCurrentOrPast == true) + #expect(tvOSVersion.v16.isCurrentOrPast == true) + #expect(tvOSVersion.v15.isCurrentOrPast == true) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 17, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == true) + #expect(tvOSVersion.v16.isCurrentOrPast == true) + #expect(tvOSVersion.v15.isCurrentOrPast == true) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 16, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == false) + #expect(tvOSVersion.v16.isCurrentOrPast == true) + #expect(tvOSVersion.v15.isCurrentOrPast == true) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 15, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == false) + #expect(tvOSVersion.v16.isCurrentOrPast == false) + #expect(tvOSVersion.v15.isCurrentOrPast == true) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 14, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, true) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == false) + #expect(tvOSVersion.v16.isCurrentOrPast == false) + #expect(tvOSVersion.v15.isCurrentOrPast == false) + #expect(tvOSVersion.v14.isCurrentOrPast == true) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } else if #available(tvOS 13, *) { - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, true) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == false) + #expect(tvOSVersion.v16.isCurrentOrPast == false) + #expect(tvOSVersion.v15.isCurrentOrPast == false) + #expect(tvOSVersion.v14.isCurrentOrPast == false) + #expect(tvOSVersion.v13.isCurrentOrPast == true) } #else - XCTAssertEqual(tvOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v18.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v17.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v16.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v15.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v14.isCurrentOrPast, false) - XCTAssertEqual(tvOSVersion.v13.isCurrentOrPast, false) + #expect(tvOSVersion.v26.isCurrentOrPast == false) + #expect(tvOSVersion.v18.isCurrentOrPast == false) + #expect(tvOSVersion.v17.isCurrentOrPast == false) + #expect(tvOSVersion.v16.isCurrentOrPast == false) + #expect(tvOSVersion.v15.isCurrentOrPast == false) + #expect(tvOSVersion.v14.isCurrentOrPast == false) + #expect(tvOSVersion.v13.isCurrentOrPast == false) #endif } - func test_visionOS_isCurrent() { + @Test func visionOS_isCurrent() { #if os(visionOS) if #available(visionOS 26, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrent, true) - XCTAssertEqual(visionOSVersion.v2.isCurrent, false) - XCTAssertEqual(visionOSVersion.v1.isCurrent, false) + #expect(visionOSVersion.v26.isCurrent == true) + #expect(visionOSVersion.v2.isCurrent == false) + #expect(visionOSVersion.v1.isCurrent == false) } else if #available(visionOS 2, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrent, false) - XCTAssertEqual(visionOSVersion.v2.isCurrent, true) - XCTAssertEqual(visionOSVersion.v1.isCurrent, false) + #expect(visionOSVersion.v26.isCurrent == false) + #expect(visionOSVersion.v2.isCurrent == true) + #expect(visionOSVersion.v1.isCurrent == false) } else if #available(visionOS 1, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrent, false) - XCTAssertEqual(visionOSVersion.v2.isCurrent, false) - XCTAssertEqual(visionOSVersion.v1.isCurrent, true) + #expect(visionOSVersion.v26.isCurrent == false) + #expect(visionOSVersion.v2.isCurrent == false) + #expect(visionOSVersion.v1.isCurrent == true) } #else - XCTAssertEqual(visionOSVersion.v26.isCurrent, false) - XCTAssertEqual(visionOSVersion.v2.isCurrent, false) - XCTAssertEqual(visionOSVersion.v1.isCurrent, false) + #expect(visionOSVersion.v26.isCurrent == false) + #expect(visionOSVersion.v2.isCurrent == false) + #expect(visionOSVersion.v1.isCurrent == false) #endif } - func test_visionOS_isCurrentOrPast() { + @Test func visionOS_isCurrentOrPast() { #if os(visionOS) if #available(visionOS 26, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrentOrPast, true) - XCTAssertEqual(visionOSVersion.v2.isCurrentOrPast, true) - XCTAssertEqual(visionOSVersion.v1.isCurrentOrPast, true) + #expect(visionOSVersion.v26.isCurrentOrPast == true) + #expect(visionOSVersion.v2.isCurrentOrPast == true) + #expect(visionOSVersion.v1.isCurrentOrPast == true) } else if #available(visionOS 2, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(visionOSVersion.v2.isCurrentOrPast, true) - XCTAssertEqual(visionOSVersion.v1.isCurrentOrPast, true) + #expect(visionOSVersion.v26.isCurrentOrPast == false) + #expect(visionOSVersion.v2.isCurrentOrPast == true) + #expect(visionOSVersion.v1.isCurrentOrPast == true) } else if #available(visionOS 1, *) { - XCTAssertEqual(visionOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(visionOSVersion.v2.isCurrentOrPast, false) - XCTAssertEqual(visionOSVersion.v1.isCurrentOrPast, true) + #expect(visionOSVersion.v26.isCurrentOrPast == false) + #expect(visionOSVersion.v2.isCurrentOrPast == false) + #expect(visionOSVersion.v1.isCurrentOrPast == true) } #else - XCTAssertEqual(visionOSVersion.v26.isCurrentOrPast, false) - XCTAssertEqual(visionOSVersion.v2.isCurrentOrPast, false) - XCTAssertEqual(visionOSVersion.v1.isCurrentOrPast, false) + #expect(visionOSVersion.v26.isCurrentOrPast == false) + #expect(visionOSVersion.v2.isCurrentOrPast == false) + #expect(visionOSVersion.v1.isCurrentOrPast == false) #endif } } From d47f01b2ceff2140c2771e748fb16203aaddbaab Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:17:53 +0100 Subject: [PATCH 59/73] WIP --- Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift index 32d1d188..50a95ca1 100644 --- a/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift +++ b/Tests/Tests/ViewTypes/NavigationViewWithStackStyleTests.swift @@ -10,7 +10,7 @@ struct NavigationViewWithStackStyleTests { typealias PlatformNavigationViewWithStackStyle = UINavigationController #endif - func testNavigationViewWithStackStyle() async throws { + @Test func introspect() async throws { try await introspection(of: PlatformNavigationViewWithStackStyle.self) { spy in NavigationView { ZStack { @@ -25,7 +25,7 @@ struct NavigationViewWithStackStyleTests { } } - func testNavigationViewWithStackStyleAsAncestor() async throws { + @Test func introspectAsAncestor() async throws { try await introspection(of: PlatformNavigationViewWithStackStyle.self) { spy in NavigationView { ZStack { From b91fb7065848616bf09d8a3ba5d00ec7a5a27f47 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:18:10 +0100 Subject: [PATCH 60/73] WIP --- Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift index 882fa999..28fc45ec 100644 --- a/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift +++ b/Tests/Tests/ViewTypes/ListWithInsetGroupedStyleTests.swift @@ -10,7 +10,7 @@ struct ListWithInsetGroupedStyleTests { typealias PlatformListWithInsetGroupedStyle = UIScrollView // covers both UITableView and UICollectionView #endif - @Test func testListWithInsetGroupedStyle() async throws { + @Test func introspect() async throws { let (entity1, entity2) = try await introspection(of: PlatformListWithInsetGroupedStyle.self) { spy1, spy2 in HStack { List { From 80577abab7f6aa9b5018f10ea91922e1af579c9d Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:18:35 +0100 Subject: [PATCH 61/73] WIP --- Tests/Tests/ViewTypes/TableTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/ViewTypes/TableTests.swift b/Tests/Tests/ViewTypes/TableTests.swift index 23466983..c9fdee06 100644 --- a/Tests/Tests/ViewTypes/TableTests.swift +++ b/Tests/Tests/ViewTypes/TableTests.swift @@ -73,7 +73,7 @@ struct TableTests { #if os(macOS) @available(macOS 12, *) - func testTableWithBorderedStyle() async throws { + @Test func introspectWithBorderedStyle() async throws { try await introspection(of: PlatformTable.self) { spy1, spy2, spy3 in VStack { TipTable() From 8e15c9dabec2bfef89f8504a4d8c5570749dc594 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:18:46 +0100 Subject: [PATCH 62/73] WIP --- Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift index e62edfb0..02899242 100644 --- a/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift +++ b/Tests/Tests/ViewTypes/ToggleWithCheckboxStyleTests.swift @@ -10,7 +10,7 @@ struct ToggleWithCheckboxStyleTests { typealias PlatformToggleWithCheckboxStyle = NSButton #endif - @Test func testToggleWithCheckboxStyle() async throws { + @Test func introspect() async throws { let (entity1, entity2, entity3) = try await introspection(of: PlatformToggleWithCheckboxStyle.self) { spy1, spy2, spy3 in VStack { Toggle("", isOn: .constant(true)) From b20d4e2bd0ee3562eca33b4e4ef9a7f83d268571 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:21:12 +0100 Subject: [PATCH 63/73] WIP --- Tests/Tests/WeakTests.swift | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Tests/Tests/WeakTests.swift b/Tests/Tests/WeakTests.swift index a626b29d..36bf5986 100644 --- a/Tests/Tests/WeakTests.swift +++ b/Tests/Tests/WeakTests.swift @@ -1,56 +1,57 @@ @_spi(Advanced) import SwiftUIIntrospect -import XCTest +import Testing -final class WeakTests: XCTestCase { +@Suite +struct WeakTests { final class Foo {} var strongFoo: Foo? = Foo() - func testInit_nil() { + @Test func Init_nil() { @Weak var weakFoo: Foo? - XCTAssertNil(weakFoo) + #expect(weakFoo == nil) } - func testInit_nonNil() { + @Test func Init_nonNil() { @Weak var weakFoo: Foo? = strongFoo - XCTAssertIdentical(weakFoo, strongFoo) + #expect(weakFoo === strongFoo) } - func testAssignment_nilToNil() { + @Test func Assignment_nilToNil() { @Weak var weakFoo: Foo? weakFoo = nil - XCTAssertNil(weakFoo) + #expect(weakFoo == nil) } - func testAssignment_nilToNonNil() { + @Test func Assignment_nilToNonNil() { @Weak var weakFoo: Foo? let otherFoo = Foo() weakFoo = otherFoo - XCTAssertIdentical(weakFoo, otherFoo) + #expect(weakFoo === otherFoo) } - func testAssignment_nonNilToNil() { + @Test func Assignment_nonNilToNil() { @Weak var weakFoo: Foo? = strongFoo weakFoo = nil - XCTAssertNil(weakFoo) + #expect(weakFoo == nil) } - func testAssignment_nonNilToNonNil() { + @Test func Assignment_nonNilToNonNil() { @Weak var weakFoo: Foo? = strongFoo let otherFoo = Foo() weakFoo = otherFoo - XCTAssertIdentical(weakFoo, otherFoo) + #expect(weakFoo === otherFoo) } - func testIndirectAssignment_nonNilToNil() { + @Test mutating func IndirectAssignment_nonNilToNil() { @Weak var weakFoo: Foo? = strongFoo strongFoo = nil - XCTAssertNil(weakFoo) + #expect(weakFoo == nil) } - func testIndirectAssignment_nonNilToNonNil() { + @Test mutating func IndirectAssignment_nonNilToNonNil() { @Weak var weakFoo: Foo? = strongFoo strongFoo = Foo() - XCTAssertNil(weakFoo) + #expect(weakFoo == nil) } } From daf699d46e0f2adf56557896eab2ba629c05a3ff Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:24:41 +0100 Subject: [PATCH 64/73] WIP --- Tests/Tests.xcodeproj/project.pbxproj | 564 ------------------ Tests/UITests/StatusBarStyleUITests.swift | 30 - Tests/UITests/UITestCase.swift | 21 - Tests/UITests/UITests.xctestplan | 24 - .../AccentColor.colorset/Contents.json | 11 - .../AppIcon.appiconset/Contents.json | 13 - .../Assets.xcassets/Contents.json | 6 - Tests/UITestsHostApp/Info.plist | 8 - Tests/UITestsHostApp/LaunchScreen.storyboard | 48 -- .../Preview Assets.xcassets/Contents.json | 6 - .../StatusBarStyle/HostingController.swift | 32 - .../StatusBarStyle/NavigationView.swift | 44 -- .../StatusBarStyle/RootView.swift | 54 -- Tests/UITestsHostApp/TestCases.swift | 3 - Tests/UITestsHostApp/UITestsHostApp.swift | 28 - 15 files changed, 892 deletions(-) delete mode 100644 Tests/UITests/StatusBarStyleUITests.swift delete mode 100644 Tests/UITests/UITestCase.swift delete mode 100644 Tests/UITests/UITests.xctestplan delete mode 100644 Tests/UITestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 Tests/UITestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Tests/UITestsHostApp/Assets.xcassets/Contents.json delete mode 100644 Tests/UITestsHostApp/Info.plist delete mode 100644 Tests/UITestsHostApp/LaunchScreen.storyboard delete mode 100644 Tests/UITestsHostApp/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 Tests/UITestsHostApp/StatusBarStyle/HostingController.swift delete mode 100644 Tests/UITestsHostApp/StatusBarStyle/NavigationView.swift delete mode 100644 Tests/UITestsHostApp/StatusBarStyle/RootView.swift delete mode 100644 Tests/UITestsHostApp/TestCases.swift delete mode 100644 Tests/UITestsHostApp/UITestsHostApp.swift diff --git a/Tests/Tests.xcodeproj/project.pbxproj b/Tests/Tests.xcodeproj/project.pbxproj index 2de80383..e998e66f 100644 --- a/Tests/Tests.xcodeproj/project.pbxproj +++ b/Tests/Tests.xcodeproj/project.pbxproj @@ -51,25 +51,12 @@ D58547FA2A1D12270068ADF4 /* NavigationSplitViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58547F92A1D12270068ADF4 /* NavigationSplitViewTests.swift */; }; D58CE15629C621B30081BFB0 /* SwiftUIIntrospect in Frameworks */ = {isa = PBXBuildFile; productRef = D58CE15529C621B30081BFB0 /* SwiftUIIntrospect */; }; D58CE15829C621DD0081BFB0 /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58CE15729C621DD0081BFB0 /* TestUtils.swift */; }; - D58D832E2A66BDD500A203BE /* StatusBarStyleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58D832D2A66BDD500A203BE /* StatusBarStyleUITests.swift */; }; - D58D83382A66C01300A203BE /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = D58D83372A66C01300A203BE /* SnapshotTesting */; }; - D58D833A2A66C04600A203BE /* SwiftUIIntrospect in Frameworks */ = {isa = PBXBuildFile; productRef = D58D83392A66C04600A203BE /* SwiftUIIntrospect */; }; - D58D83422A66C5EC00A203BE /* UITestsHostApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58D83412A66C5EC00A203BE /* UITestsHostApp.swift */; }; - D58D83462A66C5EF00A203BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D58D83452A66C5EF00A203BE /* Assets.xcassets */; }; - D58D83492A66C5EF00A203BE /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D58D83482A66C5EF00A203BE /* Preview Assets.xcassets */; }; - D58D83502A66C67A00A203BE /* TestCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58D834F2A66C67A00A203BE /* TestCases.swift */; }; D591D1122A9CC2FF00AE05E8 /* WeakTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D591D1112A9CC2FF00AE05E8 /* WeakTests.swift */; }; - D5983E7D2A66FD3F00C50953 /* TestCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = D58D834F2A66C67A00A203BE /* TestCases.swift */; }; D5AAF56F2A502EF000CAFFB6 /* MapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AAF56E2A502EF000CAFFB6 /* MapTests.swift */; }; D5AD0D912A114B98003D8DEC /* TextFieldWithVerticalAxisTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AD0D902A114B98003D8DEC /* TextFieldWithVerticalAxisTests.swift */; }; D5ADFACC2A4A22AE009494FD /* SheetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACB2A4A22AE009494FD /* SheetTests.swift */; }; D5ADFACE2A4A3482009494FD /* FullScreenCoverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACD2A4A3482009494FD /* FullScreenCoverTests.swift */; }; D5ADFAD02A4A3E54009494FD /* PopoverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5ADFACF2A4A3E54009494FD /* PopoverTests.swift */; }; - D5AEC33F2A66F31F0015AC1D /* UITestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AEC33E2A66F31F0015AC1D /* UITestCase.swift */; }; - D5AEC3442A66F6470015AC1D /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AEC3412A66F6470015AC1D /* RootView.swift */; }; - D5AEC3452A66F6470015AC1D /* HostingController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AEC3422A66F6470015AC1D /* HostingController.swift */; }; - D5AEC3462A66F6470015AC1D /* NavigationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5AEC3432A66F6470015AC1D /* NavigationView.swift */; }; - D5AEC3482A66F6AA0015AC1D /* SwiftUIIntrospect in Frameworks */ = {isa = PBXBuildFile; productRef = D5AEC3472A66F6AA0015AC1D /* SwiftUIIntrospect */; }; D5B67B842A0D318F007D5D9B /* TextFieldTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B67B832A0D318F007D5D9B /* TextFieldTests.swift */; }; D5F0BE4D29C0DBE800AD95AB /* TestsHostApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F0BE4C29C0DBE800AD95AB /* TestsHostApp.swift */; }; D5F0BE6A29C0DC4900AD95AB /* PlatformVersionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F0BE6729C0DC4900AD95AB /* PlatformVersionTests.swift */; }; @@ -77,17 +64,9 @@ D5F26E042A56E74B001209E6 /* ViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F26E032A56E74B001209E6 /* ViewControllerTests.swift */; }; D5F8D5ED2A1E7B490054E9AB /* NavigationViewWithStackStyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F8D5EC2A1E7B490054E9AB /* NavigationViewWithStackStyleTests.swift */; }; D5F8D5EF2A1E87950054E9AB /* NavigationViewWithColumnsStyleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F8D5EE2A1E87950054E9AB /* NavigationViewWithColumnsStyleTests.swift */; }; - E8B5A7882AA271BA002C4AD3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E8B5A7872AA271BA002C4AD3 /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - D58D834D2A66C61700A203BE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D5F0BE3F29C0DB9700AD95AB /* Project object */; - proxyType = 1; - remoteGlobalIDString = D58D833E2A66C5EC00A203BE; - remoteInfo = UITestsHostApp; - }; D5F0BE6129C0DC0000AD95AB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D5F0BE3F29C0DB9700AD95AB /* Project object */; @@ -101,7 +80,6 @@ D503B2AB2A49BFE300027F5F /* VideoPlayerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPlayerTests.swift; sourceTree = ""; }; D50FFE8D2A17E2A400C32641 /* ScrollViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewTests.swift; sourceTree = ""; }; D534D4DB2A4A596200218BFB /* WindowTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowTests.swift; sourceTree = ""; }; - D549D9732A66D876005D4FB5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; D55BAD132DFF2B050038443E /* WebViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewTests.swift; sourceTree = ""; }; D55F448C2A1FF209003381E4 /* ListTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTests.swift; sourceTree = ""; }; D57506772A27BBBD00A628E4 /* PickerWithSegmentedStyleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickerWithSegmentedStyleTests.swift; sourceTree = ""; }; @@ -142,24 +120,12 @@ D58547F72A1CDD740068ADF4 /* NavigationStackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationStackTests.swift; sourceTree = ""; }; D58547F92A1D12270068ADF4 /* NavigationSplitViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationSplitViewTests.swift; sourceTree = ""; }; D58CE15729C621DD0081BFB0 /* TestUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestUtils.swift; sourceTree = ""; }; - D58D832B2A66BDD500A203BE /* UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - D58D832D2A66BDD500A203BE /* StatusBarStyleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBarStyleUITests.swift; sourceTree = ""; }; - D58D833F2A66C5EC00A203BE /* UITestsHostApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UITestsHostApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - D58D83412A66C5EC00A203BE /* UITestsHostApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestsHostApp.swift; sourceTree = ""; }; - D58D83452A66C5EF00A203BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - D58D83482A66C5EF00A203BE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - D58D834F2A66C67A00A203BE /* TestCases.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestCases.swift; sourceTree = ""; }; D591D1112A9CC2FF00AE05E8 /* WeakTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeakTests.swift; sourceTree = ""; }; D5AAF56E2A502EF000CAFFB6 /* MapTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTests.swift; sourceTree = ""; }; D5AD0D902A114B98003D8DEC /* TextFieldWithVerticalAxisTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldWithVerticalAxisTests.swift; sourceTree = ""; }; D5ADFACB2A4A22AE009494FD /* SheetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetTests.swift; sourceTree = ""; }; D5ADFACD2A4A3482009494FD /* FullScreenCoverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FullScreenCoverTests.swift; sourceTree = ""; }; D5ADFACF2A4A3E54009494FD /* PopoverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopoverTests.swift; sourceTree = ""; }; - D5AEC33E2A66F31F0015AC1D /* UITestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestCase.swift; sourceTree = ""; }; - D5AEC3412A66F6470015AC1D /* RootView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = ""; }; - D5AEC3422A66F6470015AC1D /* HostingController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HostingController.swift; sourceTree = ""; }; - D5AEC3432A66F6470015AC1D /* NavigationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationView.swift; sourceTree = ""; }; - D5B5B03E2A6725500086B9DE /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = UITests.xctestplan; path = "/Users/davdroman/Developer/davdroman/swiftui-introspect/Tests/UITests/UITests.xctestplan"; sourceTree = ""; }; D5B67B832A0D318F007D5D9B /* TextFieldTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldTests.swift; sourceTree = ""; }; D5F0BE4929C0DBE800AD95AB /* TestsHostApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestsHostApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; D5F0BE4C29C0DBE800AD95AB /* TestsHostApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestsHostApp.swift; sourceTree = ""; }; @@ -169,27 +135,9 @@ D5F26E032A56E74B001209E6 /* ViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerTests.swift; sourceTree = ""; }; D5F8D5EC2A1E7B490054E9AB /* NavigationViewWithStackStyleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationViewWithStackStyleTests.swift; sourceTree = ""; }; D5F8D5EE2A1E87950054E9AB /* NavigationViewWithColumnsStyleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationViewWithColumnsStyleTests.swift; sourceTree = ""; }; - E8B5A7872AA271BA002C4AD3 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - D58D83282A66BDD500A203BE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D58D83382A66C01300A203BE /* SnapshotTesting in Frameworks */, - D58D833A2A66C04600A203BE /* SwiftUIIntrospect in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D58D833C2A66C5EC00A203BE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D5AEC3482A66F6AA0015AC1D /* SwiftUIIntrospect in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; D5F0BE4629C0DBE800AD95AB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -208,64 +156,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - D5459AA32A67072F00F0D737 /* __Snapshots__ */ = { - isa = PBXGroup; - children = ( - D5459AA42A67072F00F0D737 /* StatusBarStyleUITests */, - ); - path = __Snapshots__; - sourceTree = ""; - }; - D5459AA42A67072F00F0D737 /* StatusBarStyleUITests */ = { - isa = PBXGroup; - children = ( - ); - path = StatusBarStyleUITests; - sourceTree = ""; - }; - D58D832C2A66BDD500A203BE /* UITests */ = { - isa = PBXGroup; - children = ( - D5B5B03E2A6725500086B9DE /* UITests.xctestplan */, - D58D832D2A66BDD500A203BE /* StatusBarStyleUITests.swift */, - D5AEC33E2A66F31F0015AC1D /* UITestCase.swift */, - D5459AA32A67072F00F0D737 /* __Snapshots__ */, - ); - path = UITests; - sourceTree = ""; - }; - D58D83402A66C5EC00A203BE /* UITestsHostApp */ = { - isa = PBXGroup; - children = ( - E8B5A7872AA271BA002C4AD3 /* LaunchScreen.storyboard */, - D549D9732A66D876005D4FB5 /* Info.plist */, - D58D83412A66C5EC00A203BE /* UITestsHostApp.swift */, - D58D834F2A66C67A00A203BE /* TestCases.swift */, - D5AEC3402A66F6210015AC1D /* StatusBarStyle */, - D58D83452A66C5EF00A203BE /* Assets.xcassets */, - D58D83472A66C5EF00A203BE /* Preview Content */, - ); - path = UITestsHostApp; - sourceTree = ""; - }; - D58D83472A66C5EF00A203BE /* Preview Content */ = { - isa = PBXGroup; - children = ( - D58D83482A66C5EF00A203BE /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - D5AEC3402A66F6210015AC1D /* StatusBarStyle */ = { - isa = PBXGroup; - children = ( - D5AEC3422A66F6470015AC1D /* HostingController.swift */, - D5AEC3432A66F6470015AC1D /* NavigationView.swift */, - D5AEC3412A66F6470015AC1D /* RootView.swift */, - ); - path = StatusBarStyle; - sourceTree = ""; - }; D5B67B852A0D3193007D5D9B /* ViewTypes */ = { isa = PBXGroup; children = ( @@ -330,8 +220,6 @@ children = ( D5F0BE4B29C0DBE800AD95AB /* TestsHostApp */, D5F0BE5E29C0DC0000AD95AB /* Tests */, - D58D83402A66C5EC00A203BE /* UITestsHostApp */, - D58D832C2A66BDD500A203BE /* UITests */, D5F0BE4A29C0DBE800AD95AB /* Products */, D5F0BE7029C0E12300AD95AB /* Frameworks */, ); @@ -342,8 +230,6 @@ children = ( D5F0BE4929C0DBE800AD95AB /* TestsHostApp.app */, D5F0BE5D29C0DC0000AD95AB /* Tests.xctest */, - D58D832B2A66BDD500A203BE /* UITests.xctest */, - D58D833F2A66C5EC00A203BE /* UITestsHostApp.app */, ); name = Products; sourceTree = ""; @@ -377,48 +263,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - D58D832A2A66BDD500A203BE /* UITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = D58D83352A66BDD500A203BE /* Build configuration list for PBXNativeTarget "UITests" */; - buildPhases = ( - D58D83272A66BDD500A203BE /* Sources */, - D58D83282A66BDD500A203BE /* Frameworks */, - D58D83292A66BDD500A203BE /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - D58D834E2A66C61700A203BE /* PBXTargetDependency */, - ); - name = UITests; - packageProductDependencies = ( - D58D83372A66C01300A203BE /* SnapshotTesting */, - D58D83392A66C04600A203BE /* SwiftUIIntrospect */, - ); - productName = UITests; - productReference = D58D832B2A66BDD500A203BE /* UITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; - D58D833E2A66C5EC00A203BE /* UITestsHostApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = D58D834C2A66C5EF00A203BE /* Build configuration list for PBXNativeTarget "UITestsHostApp" */; - buildPhases = ( - D58D833B2A66C5EC00A203BE /* Sources */, - D58D833C2A66C5EC00A203BE /* Frameworks */, - D58D833D2A66C5EC00A203BE /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = UITestsHostApp; - packageProductDependencies = ( - D5AEC3472A66F6AA0015AC1D /* SwiftUIIntrospect */, - ); - productName = UITestsHostApp; - productReference = D58D833F2A66C5EC00A203BE /* UITestsHostApp.app */; - productType = "com.apple.product-type.application"; - }; D5F0BE4829C0DBE800AD95AB /* TestsHostApp */ = { isa = PBXNativeTarget; buildConfigurationList = D5F0BE5829C0DBE900AD95AB /* Build configuration list for PBXNativeTarget "TestsHostApp" */; @@ -467,13 +311,6 @@ LastSwiftUpdateCheck = 1500; LastUpgradeCheck = 1500; TargetAttributes = { - D58D832A2A66BDD500A203BE = { - CreatedOnToolsVersion = 15.0; - TestTargetID = D58D833E2A66C5EC00A203BE; - }; - D58D833E2A66C5EC00A203BE = { - CreatedOnToolsVersion = 15.0; - }; D5F0BE4829C0DBE800AD95AB = { CreatedOnToolsVersion = 14.2; }; @@ -502,30 +339,11 @@ targets = ( D5F0BE4829C0DBE800AD95AB /* TestsHostApp */, D5F0BE5C29C0DC0000AD95AB /* Tests */, - D58D833E2A66C5EC00A203BE /* UITestsHostApp */, - D58D832A2A66BDD500A203BE /* UITests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - D58D83292A66BDD500A203BE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D58D833D2A66C5EC00A203BE /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E8B5A7882AA271BA002C4AD3 /* LaunchScreen.storyboard in Resources */, - D58D83492A66C5EF00A203BE /* Preview Assets.xcassets in Resources */, - D58D83462A66C5EF00A203BE /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; D5F0BE4729C0DBE800AD95AB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -543,28 +361,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - D58D83272A66BDD500A203BE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D58D832E2A66BDD500A203BE /* StatusBarStyleUITests.swift in Sources */, - D5AEC33F2A66F31F0015AC1D /* UITestCase.swift in Sources */, - D5983E7D2A66FD3F00C50953 /* TestCases.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - D58D833B2A66C5EC00A203BE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D58D83422A66C5EC00A203BE /* UITestsHostApp.swift in Sources */, - D58D83502A66C67A00A203BE /* TestCases.swift in Sources */, - D5AEC3462A66F6470015AC1D /* NavigationView.swift in Sources */, - D5AEC3452A66F6470015AC1D /* HostingController.swift in Sources */, - D5AEC3442A66F6470015AC1D /* RootView.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; D5F0BE4529C0DBE800AD95AB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -638,11 +434,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - D58D834E2A66C61700A203BE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D58D833E2A66C5EC00A203BE /* UITestsHostApp */; - targetProxy = D58D834D2A66C61700A203BE /* PBXContainerItemProxy */; - }; D5F0BE6229C0DC0000AD95AB /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D5F0BE4829C0DBE800AD95AB /* TestsHostApp */; @@ -651,330 +442,6 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - D58D83332A66BDD500A203BE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.siteline.UITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = UITestsHostApp; - TVOS_DEPLOYMENT_TARGET = 14.0; - }; - name = Debug; - }; - D58D83342A66BDD500A203BE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = ""; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.siteline.UITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_TARGET_NAME = UITestsHostApp; - TVOS_DEPLOYMENT_TARGET = 14.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - D58D834A2A66C5EF00A203BE /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_ASSET_PATHS = "\"UITestsHostApp/Preview Content\""; - ENABLE_PREVIEWS = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = UITestsHostApp/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.siteline.UITestsHostApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - D58D834B2A66C5EF00A203BE /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_STYLE = Automatic; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_ASSET_PATHS = "\"UITestsHostApp/Preview Content\""; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_PREVIEWS = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = UITestsHostApp/Info.plist; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen.storyboard; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.siteline.UITestsHostApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; - SUPPORTS_MACCATALYST = NO; - SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; - SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; D5F0BE4329C0DB9700AD95AB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1400,24 +867,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - D58D83352A66BDD500A203BE /* Build configuration list for PBXNativeTarget "UITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D58D83332A66BDD500A203BE /* Debug */, - D58D83342A66BDD500A203BE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D58D834C2A66C5EF00A203BE /* Build configuration list for PBXNativeTarget "UITestsHostApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D58D834A2A66C5EF00A203BE /* Debug */, - D58D834B2A66C5EF00A203BE /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; D5F0BE4229C0DB9700AD95AB /* Build configuration list for PBXProject "Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1463,19 +912,6 @@ isa = XCSwiftPackageProductDependency; productName = SwiftUIIntrospect; }; - D58D83372A66C01300A203BE /* SnapshotTesting */ = { - isa = XCSwiftPackageProductDependency; - package = D58D83362A66C01300A203BE /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */; - productName = SnapshotTesting; - }; - D58D83392A66C04600A203BE /* SwiftUIIntrospect */ = { - isa = XCSwiftPackageProductDependency; - productName = SwiftUIIntrospect; - }; - D5AEC3472A66F6AA0015AC1D /* SwiftUIIntrospect */ = { - isa = XCSwiftPackageProductDependency; - productName = SwiftUIIntrospect; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = D5F0BE3F29C0DB9700AD95AB /* Project object */; diff --git a/Tests/UITests/StatusBarStyleUITests.swift b/Tests/UITests/StatusBarStyleUITests.swift deleted file mode 100644 index 0404986d..00000000 --- a/Tests/UITests/StatusBarStyleUITests.swift +++ /dev/null @@ -1,30 +0,0 @@ -import SnapshotTesting -import XCTest - -final class StatusBarStyleUITests: UITestCase { - override var testCase: TestCase { - .statusBarStyle - } - - func test() throws { - guard #unavailable(iOS 17) else { - throw XCTSkip("SimulatorStatusMagic stopped working in iOS 17, so we can no longer consistently compare status bar screenshots") - } - - app.buttons["Navigate To Detail"].tap() - app.buttons["Navigate To Detail"].tap() - app.buttons["Navigate Back"].tap() - - let iOSDevice = UIDevice.current.userInterfaceIdiom == .pad ? "ipad" : "iphone" - let iOSVersion = ProcessInfo().operatingSystemVersion - func screenshotName(_ number: Int) -> String { - "\(iOSDevice)-ios-\(iOSVersion.majorVersion)-screenshot-\(number)" - } - - assertSnapshot( - matching: app.windows.firstMatch.screenshot().image, - as: .image(perceptualPrecision: 0.95), - named: screenshotName(1) - ) - } -} diff --git a/Tests/UITests/UITestCase.swift b/Tests/UITests/UITestCase.swift deleted file mode 100644 index d99d199b..00000000 --- a/Tests/UITests/UITestCase.swift +++ /dev/null @@ -1,21 +0,0 @@ -import SimulatorStatusMagic -import XCTest - -class UITestCase: XCTestCase { - var testCase: TestCase { - preconditionFailure("Please override this property") - } - - let app = XCUIApplication() - - override func invokeTest() { - SDStatusBarManager.sharedInstance().enableOverrides() - - continueAfterFailure = false - - app.launchEnvironment["testCase"] = testCase.rawValue - app.launch() - - super.invokeTest() - } -} diff --git a/Tests/UITests/UITests.xctestplan b/Tests/UITests/UITests.xctestplan deleted file mode 100644 index 403bcc61..00000000 --- a/Tests/UITests/UITests.xctestplan +++ /dev/null @@ -1,24 +0,0 @@ -{ - "configurations" : [ - { - "id" : "DD0EEECD-4762-4A68-91A8-F7B5A2209B45", - "name" : "Test Scheme Action", - "options" : { - - } - } - ], - "defaultOptions" : { - - }, - "testTargets" : [ - { - "target" : { - "containerPath" : "container:Tests.xcodeproj", - "identifier" : "D58D832A2A66BDD500A203BE", - "name" : "UITests" - } - } - ], - "version" : 1 -} diff --git a/Tests/UITestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Tests/UITestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb878970..00000000 --- a/Tests/UITestsHostApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Tests/UITestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Tests/UITestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3e..00000000 --- a/Tests/UITestsHostApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Tests/UITestsHostApp/Assets.xcassets/Contents.json b/Tests/UITestsHostApp/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/Tests/UITestsHostApp/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Tests/UITestsHostApp/Info.plist b/Tests/UITestsHostApp/Info.plist deleted file mode 100644 index 364d0f3e..00000000 --- a/Tests/UITestsHostApp/Info.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/Tests/UITestsHostApp/LaunchScreen.storyboard b/Tests/UITestsHostApp/LaunchScreen.storyboard deleted file mode 100644 index 88498757..00000000 --- a/Tests/UITestsHostApp/LaunchScreen.storyboard +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tests/UITestsHostApp/Preview Content/Preview Assets.xcassets/Contents.json b/Tests/UITestsHostApp/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596..00000000 --- a/Tests/UITestsHostApp/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Tests/UITestsHostApp/StatusBarStyle/HostingController.swift b/Tests/UITestsHostApp/StatusBarStyle/HostingController.swift deleted file mode 100644 index 1b13e8b1..00000000 --- a/Tests/UITestsHostApp/StatusBarStyle/HostingController.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// HostingController.swift -// Blago -// -// Created by Dmytro Chumakov on 04.05.2023. -// - -import SwiftUI - -final class HostingController: UIHostingController where ContentView: View { - - var statusBarStyle: UIStatusBarStyle = .darkContent - var isInteractivePopGestureEnabled = true - - override var preferredStatusBarStyle: UIStatusBarStyle { - statusBarStyle - } - - override func viewDidLoad() { - super.viewDidLoad() - navigationController?.interactivePopGestureRecognizer?.isEnabled = isInteractivePopGestureEnabled - } - - override func viewWillLayoutSubviews() { - super.viewWillLayoutSubviews() - - guard #available(iOS 16, *) else { - navigationController?.setNavigationBarHidden(true, animated: false) - return - } - } -} diff --git a/Tests/UITestsHostApp/StatusBarStyle/NavigationView.swift b/Tests/UITestsHostApp/StatusBarStyle/NavigationView.swift deleted file mode 100644 index 85e35354..00000000 --- a/Tests/UITestsHostApp/StatusBarStyle/NavigationView.swift +++ /dev/null @@ -1,44 +0,0 @@ - -// -// NavigationController.swift -// Blago -// -// Created by Dmytro Chumakov on 11.05.2023. -// - -import UIKit - -// MARK: - NavigationController - -final class NavigationController: UINavigationController { - - static var shared: UINavigationController? - - // MARK: Lifecycle - - override init(rootViewController: UIViewController) { - super.init(rootViewController: rootViewController) - setNavigationBarHidden(true, animated: false) - } - - required init?(coder _: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override var preferredStatusBarStyle: UIStatusBarStyle { - topViewController?.preferredStatusBarStyle ?? .default - } - - override func viewDidLoad() { - super.viewDidLoad() - interactivePopGestureRecognizer?.delegate = self - } -} - -// MARK: UIGestureRecognizerDelegate - -extension NavigationController: UIGestureRecognizerDelegate { - func gestureRecognizerShouldBegin(_: UIGestureRecognizer) -> Bool { - viewControllers.count > 1 - } -} diff --git a/Tests/UITestsHostApp/StatusBarStyle/RootView.swift b/Tests/UITestsHostApp/StatusBarStyle/RootView.swift deleted file mode 100644 index ed410cf8..00000000 --- a/Tests/UITestsHostApp/StatusBarStyle/RootView.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// RootView.swift -// Showcase -// -// Created by Orackle on 14.07.2023. -// - -import SwiftUI -import SwiftUIIntrospect - -struct RootView: View { - - var body: some View { - VStack { - Button("Navigate To Detail", action: navigateToDetail) - } - } - - @MainActor // for below Swift 6.0 - private func navigateToDetail() { - let controller = HostingController(rootView: DetailView()) - controller.statusBarStyle = .lightContent - NavigationController.shared?.pushViewController(controller, animated: true) - } -} - -struct DetailView: View { - @Environment(\.presentationMode) var dismiss - - var body: some View { - ZStack { - Color.red.edgesIgnoringSafeArea(.all) - - VStack { - Button("Navigate To Detail", action: navigateToDetail) - Button("Navigate Back", action: goBack) - } - } - .introspect(.viewController, on: .iOS(.v13, .v14, .v15, .v16)) { viewController in - /// some customizations there - } - } - - private func goBack() { - dismiss.wrappedValue.dismiss() - } - - @MainActor // for below Swift 6.0 - private func navigateToDetail() { - let controller = HostingController(rootView: DetailView()) - controller.statusBarStyle = .lightContent - NavigationController.shared?.pushViewController(controller, animated: true) - } -} diff --git a/Tests/UITestsHostApp/TestCases.swift b/Tests/UITestsHostApp/TestCases.swift deleted file mode 100644 index 64285580..00000000 --- a/Tests/UITestsHostApp/TestCases.swift +++ /dev/null @@ -1,3 +0,0 @@ -public enum TestCase: String { - case statusBarStyle = "Status Bar Style" -} diff --git a/Tests/UITestsHostApp/UITestsHostApp.swift b/Tests/UITestsHostApp/UITestsHostApp.swift deleted file mode 100644 index 0069c252..00000000 --- a/Tests/UITestsHostApp/UITestsHostApp.swift +++ /dev/null @@ -1,28 +0,0 @@ -import SwiftUI - -@main -final class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - window = UIWindow(frame: UIScreen.main.bounds) - guard - let testCaseRawValue = ProcessInfo.processInfo.environment["testCase"], - let testCase = TestCase(rawValue: testCaseRawValue) - else { - preconditionFailure("entryViewController not set") - } - - window?.rootViewController = { - switch testCase { - case .statusBarStyle: - let navController = NavigationController(rootViewController: HostingController(rootView: RootView())) - NavigationController.shared = navController - return navController - } - }() - window?.makeKeyAndVisible() - return true - } -} From 8fe4e811ec3caf824ddee4fc5e3e863325418915 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:25:38 +0100 Subject: [PATCH 65/73] WIP --- .github/workflows/ci.yml | 4 ---- fastlane/Fastfile | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d807a0b..7ca2843e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,3 @@ jobs: - if: ${{ matrix.platform[0] != 'watchOS' }} name: Run Tests run: fastlane test platform:${{ matrix.platform[0] }} version:${{ matrix.platform[1] }} scheme:SwiftUIIntrospectTests configuration:Debug - - # - if: ${{ matrix.platform[0] == 'iOS' && matrix.platform[1] <= '16' }} - # name: Run UI Tests - # run: fastlane test platform:${{ matrix.platform[0] }} version:${{ matrix.platform[1] }} scheme:SwiftUIIntrospectUITests configuration:Debug diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9a1187ed..c2780ff8 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -79,7 +79,7 @@ lane :test do |options| disable_concurrent_testing: true, ) else - unless ["SwiftUIIntrospectTests", "SwiftUIIntrospectUITests"].include?(scheme) + unless ["SwiftUIIntrospectTests"].include?(scheme) raise "Unsupported scheme: #{scheme}" end run_tests( From 5a4ae22d0f0701e45bcba3376cbe425984654490 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:26:36 +0100 Subject: [PATCH 66/73] WIP --- .../SwiftUIIntrospectUITests.xcscheme | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectUITests.xcscheme diff --git a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectUITests.xcscheme b/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectUITests.xcscheme deleted file mode 100644 index 2745a978..00000000 --- a/Tests/Tests.xcodeproj/xcshareddata/xcschemes/SwiftUIIntrospectUITests.xcscheme +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 64a38854412c8b5b7fe6f0e006420856d48975ab Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:27:59 +0100 Subject: [PATCH 67/73] WIP --- .../xcshareddata/swiftpm/Package.resolved | 14 -------------- Tests/Tests.xcodeproj/project.pbxproj | 12 ------------ 2 files changed, 26 deletions(-) delete mode 100644 SwiftUIIntrospect.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/SwiftUIIntrospect.xcworkspace/xcshareddata/swiftpm/Package.resolved b/SwiftUIIntrospect.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index 01642cef..00000000 --- a/SwiftUIIntrospect.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,14 +0,0 @@ -{ - "pins" : [ - { - "identity" : "swift-snapshot-testing", - "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/swift-snapshot-testing.git", - "state" : { - "revision" : "dc46eeb3928a75390651fac6c1ef7f93ad59a73b", - "version" : "1.11.1" - } - } - ], - "version" : 2 -} diff --git a/Tests/Tests.xcodeproj/project.pbxproj b/Tests/Tests.xcodeproj/project.pbxproj index e998e66f..30f6ad12 100644 --- a/Tests/Tests.xcodeproj/project.pbxproj +++ b/Tests/Tests.xcodeproj/project.pbxproj @@ -331,7 +331,6 @@ ); mainGroup = D5F0BE3E29C0DB9700AD95AB; packageReferences = ( - D58D83362A66C01300A203BE /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */, ); productRefGroup = D5F0BE4A29C0DBE800AD95AB /* Products */; projectDirPath = ""; @@ -896,17 +895,6 @@ }; /* End XCConfigurationList section */ -/* Begin XCRemoteSwiftPackageReference section */ - D58D83362A66C01300A203BE /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 1.11.1; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - /* Begin XCSwiftPackageProductDependency section */ D58CE15529C621B30081BFB0 /* SwiftUIIntrospect */ = { isa = XCSwiftPackageProductDependency; From 0842fc0f5a492a7e2aa8965bcfdf167d7d742c31 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:38:26 +0100 Subject: [PATCH 68/73] WIP --- Tests/Tests/TestUtils.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index a0ea619c..6c7de51c 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -47,8 +47,8 @@ enum TestUtils { func introspection( of type: Entity.Type, @ViewBuilder view: ( - _ spy1: @escaping (Entity) -> Void, - ) -> some View, + _ spy1: @escaping (Entity) -> Void + ) -> some View ) async throws -> Entity { var entity1: Entity? return try await confirmation(expectedCount: 1...) { confirmation1 in @@ -75,8 +75,8 @@ func introspection( of type: Entity.Type, @ViewBuilder view: ( _ spy1: @escaping (Entity) -> Void, - _ spy2: @escaping (Entity) -> Void, - ) -> some View, + _ spy2: @escaping (Entity) -> Void + ) -> some View ) async throws -> (Entity, Entity) { var entity1: Entity? var entity2: Entity? @@ -117,8 +117,8 @@ func introspection( @ViewBuilder view: ( _ spy1: @escaping (Entity) -> Void, _ spy2: @escaping (Entity) -> Void, - _ spy3: @escaping (Entity) -> Void, - ) -> some View, + _ spy3: @escaping (Entity) -> Void + ) -> some View ) async throws -> (Entity, Entity, Entity) { var entity1: Entity? var entity2: Entity? @@ -169,8 +169,8 @@ func introspection( _ spy1: @escaping (Entity) -> Void, _ spy2: @escaping (Entity) -> Void, _ spy3: @escaping (Entity) -> Void, - _ spy4: @escaping (Entity) -> Void, - ) -> some View, + _ spy4: @escaping (Entity) -> Void + ) -> some View ) async throws -> (Entity, Entity, Entity, Entity) { var entity1: Entity? var entity2: Entity? From ba684e707e2ed85ffef23479cebeda23da021e65 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:58:11 +0100 Subject: [PATCH 69/73] WIP --- Tests/Tests/TestUtils.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index 6c7de51c..2a390dc6 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -56,7 +56,7 @@ func introspection( { confirmation1() entity1 = $0 - }, + } ) TestUtils.present(view: view) @@ -90,7 +90,7 @@ func introspection( { confirmation2() entity2 = $0 - }, + } ) TestUtils.present(view: view) @@ -104,7 +104,7 @@ func introspection( return try ( #require(entity1), - #require(entity2), + #require(entity2) ) } } @@ -138,7 +138,7 @@ func introspection( { confirmation3() entity3 = $0 - }, + } ) TestUtils.present(view: view) @@ -154,7 +154,7 @@ func introspection( return try ( #require(entity1), #require(entity2), - #require(entity3), + #require(entity3) ) } } @@ -196,7 +196,7 @@ func introspection( { confirmation4() entity4 = $0 - }, + } ) TestUtils.present(view: view) @@ -214,7 +214,7 @@ func introspection( #require(entity1), #require(entity2), #require(entity3), - #require(entity4), + #require(entity4) ) } } From 1aa2e29784ea3f5df425f37d412bd73ab2e05b4b Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:00:17 +0100 Subject: [PATCH 70/73] WIP --- Tests/Tests/TestUtils.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index 2a390dc6..f34cac67 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -51,7 +51,7 @@ func introspection( ) -> some View ) async throws -> Entity { var entity1: Entity? - return try await confirmation(expectedCount: 1...) { confirmation1 in + return try await confirmation(expectedCount: 1...3) { confirmation1 in let view = view( { confirmation1() @@ -80,8 +80,8 @@ func introspection( ) async throws -> (Entity, Entity) { var entity1: Entity? var entity2: Entity? - return try await confirmation(expectedCount: 1...) { confirmation1 in - try await confirmation(expectedCount: 1...) { confirmation2 in + return try await confirmation(expectedCount: 1...3) { confirmation1 in + try await confirmation(expectedCount: 1...3) { confirmation2 in let view = view( { confirmation1() @@ -123,9 +123,9 @@ func introspection( var entity1: Entity? var entity2: Entity? var entity3: Entity? - return try await confirmation(expectedCount: 1...) { confirmation1 in - try await confirmation(expectedCount: 1...) { confirmation2 in - try await confirmation(expectedCount: 1...) { confirmation3 in + return try await confirmation(expectedCount: 1...3) { confirmation1 in + try await confirmation(expectedCount: 1...3) { confirmation2 in + try await confirmation(expectedCount: 1...3) { confirmation3 in let view = view( { confirmation1() @@ -176,10 +176,10 @@ func introspection( var entity2: Entity? var entity3: Entity? var entity4: Entity? - return try await confirmation(expectedCount: 1...) { confirmation1 in - try await confirmation(expectedCount: 1...) { confirmation2 in - try await confirmation(expectedCount: 1...) { confirmation3 in - try await confirmation(expectedCount: 1...) { confirmation4 in + return try await confirmation(expectedCount: 1...3) { confirmation1 in + try await confirmation(expectedCount: 1...3) { confirmation2 in + try await confirmation(expectedCount: 1...3) { confirmation3 in + try await confirmation(expectedCount: 1...3) { confirmation4 in let view = view( { confirmation1() From 5eb5462dc0b3f14c10ebc3b5a30d4b654f0040ba Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:28:34 +0100 Subject: [PATCH 71/73] Revert "WIP" This reverts commit 1aa2e29784ea3f5df425f37d412bd73ab2e05b4b. --- Tests/Tests/TestUtils.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index f34cac67..2a390dc6 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -51,7 +51,7 @@ func introspection( ) -> some View ) async throws -> Entity { var entity1: Entity? - return try await confirmation(expectedCount: 1...3) { confirmation1 in + return try await confirmation(expectedCount: 1...) { confirmation1 in let view = view( { confirmation1() @@ -80,8 +80,8 @@ func introspection( ) async throws -> (Entity, Entity) { var entity1: Entity? var entity2: Entity? - return try await confirmation(expectedCount: 1...3) { confirmation1 in - try await confirmation(expectedCount: 1...3) { confirmation2 in + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in let view = view( { confirmation1() @@ -123,9 +123,9 @@ func introspection( var entity1: Entity? var entity2: Entity? var entity3: Entity? - return try await confirmation(expectedCount: 1...3) { confirmation1 in - try await confirmation(expectedCount: 1...3) { confirmation2 in - try await confirmation(expectedCount: 1...3) { confirmation3 in + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in + try await confirmation(expectedCount: 1...) { confirmation3 in let view = view( { confirmation1() @@ -176,10 +176,10 @@ func introspection( var entity2: Entity? var entity3: Entity? var entity4: Entity? - return try await confirmation(expectedCount: 1...3) { confirmation1 in - try await confirmation(expectedCount: 1...3) { confirmation2 in - try await confirmation(expectedCount: 1...3) { confirmation3 in - try await confirmation(expectedCount: 1...3) { confirmation4 in + return try await confirmation(expectedCount: 1...) { confirmation1 in + try await confirmation(expectedCount: 1...) { confirmation2 in + try await confirmation(expectedCount: 1...) { confirmation3 in + try await confirmation(expectedCount: 1...) { confirmation4 in let view = view( { confirmation1() From 2049261704f809ecafecc6cd36501595fe5f2c15 Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:35:20 +0100 Subject: [PATCH 72/73] WIP --- .github/workflows/ci.yml | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3111442..d881c44a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,18 +42,19 @@ jobs: include: - platform: [iOS, 15] runtime: iOS 15.5 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [iOS, 16] runtime: iOS 16.4 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [iOS, 17] runtime: iOS 17.5 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 + install: true - platform: [iOS, 18] runtime: iOS 18.5 os: macos-15 @@ -65,18 +66,19 @@ jobs: - platform: [tvOS, 15] runtime: tvOS 15.4 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [tvOS, 16] runtime: tvOS 16.4 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [tvOS, 17] runtime: tvOS 17.5 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 + install: true - platform: [tvOS, 18] runtime: tvOS 18.5 os: macos-15 @@ -88,18 +90,19 @@ jobs: - platform: [watchOS, 8] runtime: watchOS 8.5 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [watchOS, 9] runtime: watchOS 9.4 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 install: true - platform: [watchOS, 10] runtime: watchOS 10.5 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 + install: true - platform: [watchOS, 11] runtime: watchOS 11.5 os: macos-15 @@ -109,14 +112,10 @@ jobs: # os: macos-15 # xcode: 26.0 - - platform: [macOS, 14] - runtime: macOS 14 - os: macos-14 - xcode: 16.2 - platform: [macOS, 15] runtime: macOS 15 os: macos-15 - xcode: 16.2 + xcode: 16.4 # - platform: [macOS, 26] # runtime: macOS 26.0 # os: macos-15 @@ -124,8 +123,9 @@ jobs: - platform: [visionOS, 1] runtime: visionOS 1.2 - os: macos-14 - xcode: 16.2 + os: macos-15 + xcode: 16.4 + install: true - platform: [visionOS, 2] runtime: visionOS 2.5 os: macos-15 From eeb8eb848fe8a136024c1d771344f3f4f34cf45d Mon Sep 17 00:00:00 2001 From: David Roman <2538074+davdroman@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:36:21 +0100 Subject: [PATCH 73/73] Revert "WIP" This reverts commit ba684e707e2ed85ffef23479cebeda23da021e65. --- Tests/Tests/TestUtils.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/Tests/TestUtils.swift b/Tests/Tests/TestUtils.swift index 2a390dc6..6c7de51c 100644 --- a/Tests/Tests/TestUtils.swift +++ b/Tests/Tests/TestUtils.swift @@ -56,7 +56,7 @@ func introspection( { confirmation1() entity1 = $0 - } + }, ) TestUtils.present(view: view) @@ -90,7 +90,7 @@ func introspection( { confirmation2() entity2 = $0 - } + }, ) TestUtils.present(view: view) @@ -104,7 +104,7 @@ func introspection( return try ( #require(entity1), - #require(entity2) + #require(entity2), ) } } @@ -138,7 +138,7 @@ func introspection( { confirmation3() entity3 = $0 - } + }, ) TestUtils.present(view: view) @@ -154,7 +154,7 @@ func introspection( return try ( #require(entity1), #require(entity2), - #require(entity3) + #require(entity3), ) } } @@ -196,7 +196,7 @@ func introspection( { confirmation4() entity4 = $0 - } + }, ) TestUtils.present(view: view) @@ -214,7 +214,7 @@ func introspection( #require(entity1), #require(entity2), #require(entity3), - #require(entity4) + #require(entity4), ) } }