66import Foundation
77import PathKit
88import SelectiveTestingCore
9+ import Testing
910import Workspace
10- import XCTest
1111
12- final class DependencyCalculatorTests : XCTestCase {
12+ @Suite
13+ struct DependencyCalculatorTests {
1314 func depStructure( ) -> ( DependencyGraph , TargetIdentity , TargetIdentity , TargetIdentity , TargetIdentity , TargetIdentity , TargetIdentity ) {
1415 let mainApp = TargetIdentity . project ( path: " /folder/Project.xcodepoj " , targetName: " MainApp " , testTarget: false )
1516 let mainAppTests = TargetIdentity . project ( path: " /folder/Project.xcodepoj " , targetName: " MainAppTests " , testTarget: true )
@@ -35,8 +36,8 @@ final class DependencyCalculatorTests: XCTestCase {
3536 return ( depsGraph, mainApp, module, submodule, mainAppTests, moduleTests, submoduleTests)
3637 }
3738
38- func testGraphIntegrity_submodule ( ) async throws {
39- // given
39+ @ Test
40+ func graphIntegrity_submodule ( ) async throws {
4041 let ( depsGraph, mainApp, module, submodule, mainAppTests, moduleTests, submoduleTests) = depStructure ( )
4142
4243 let files = Set ( [ Path ( " /folder/submodule/file.swift " ) ] )
@@ -45,16 +46,14 @@ final class DependencyCalculatorTests: XCTestCase {
4546 folders: [ : ] ,
4647 dependencyStructure: depsGraph,
4748 candidateTestPlan: nil )
48- // when
4949
5050 let affected = graph. affectedTargets ( changedFiles: files)
5151
52- // then
53- XCTAssertEqual ( affected, Set ( [ mainApp, mainAppTests, module, moduleTests, submodule, submoduleTests] ) )
52+ #expect( affected == Set ( [ mainApp, mainAppTests, module, moduleTests, submodule, submoduleTests] ) )
5453 }
5554
56- func testGraphIntegrity_mainApp ( ) async throws {
57- // given
55+ @ Test
56+ func graphIntegrity_mainApp ( ) async throws {
5857 let ( depsGraph, mainApp, _, _, mainAppTests, _, _) = depStructure ( )
5958
6059 let files = Set ( [ Path ( " /folder/submodule/file.swift " ) ] )
@@ -63,16 +62,14 @@ final class DependencyCalculatorTests: XCTestCase {
6362 folders: [ : ] ,
6463 dependencyStructure: depsGraph,
6564 candidateTestPlan: nil )
66- // when
6765
6866 let affected = graph. affectedTargets ( changedFiles: files)
6967
70- // then
71- XCTAssertEqual ( affected, Set ( [ mainApp, mainAppTests] ) )
68+ #expect( affected == Set ( [ mainApp, mainAppTests] ) )
7269 }
7370
74- func testGraphIntegrity_module ( ) async throws {
75- // given
71+ @ Test
72+ func graphIntegrity_module ( ) async throws {
7673 let ( depsGraph, mainApp, module, _, mainAppTests, moduleTests, _) = depStructure ( )
7774
7875 let files = Set ( [ Path ( " /folder/submodule/file.swift " ) ] )
@@ -81,11 +78,9 @@ final class DependencyCalculatorTests: XCTestCase {
8178 folders: [ : ] ,
8279 dependencyStructure: depsGraph,
8380 candidateTestPlan: nil )
84- // when
8581
8682 let affected = graph. affectedTargets ( changedFiles: files)
8783
88- // then
89- XCTAssertEqual ( affected, Set ( [ module, moduleTests, mainApp, mainAppTests] ) )
84+ #expect( affected == Set ( [ module, moduleTests, mainApp, mainAppTests] ) )
9085 }
9186}
0 commit comments