55//
66
77@testable import PADOutputGenerator
8- import Testing
8+ import XCTest
99
10- class OutputGeneratorTests {
10+ class OutputGeneratorTests : XCTestCase {
1111
12- @Test
13- func noChanges_singleModule( ) {
12+ func test_noChanges_singleModule( ) {
1413
1514 let expectedOutput = """
1615 # ✅ No changes detected
@@ -29,11 +28,10 @@ class OutputGeneratorTests {
2928 warnings: [ ]
3029 )
3130
32- #expect ( output == expectedOutput)
31+ XCTAssertEqual ( output, expectedOutput)
3332 }
3433
35- @Test
36- func oneChange_singleModule( ) {
34+ func test_oneChange_singleModule( ) {
3735
3836 let expectedOutput = """
3937 # 👀 1 public change detected
@@ -61,10 +59,9 @@ class OutputGeneratorTests {
6159 warnings: [ ]
6260 )
6361
64- #expect ( output == expectedOutput)
62+ XCTAssertEqual ( output, expectedOutput)
6563 }
6664
67- @Test
6865 func multipleChanges_multipleModules( ) {
6966
7067 let expectedOutput = """
@@ -115,36 +112,41 @@ class OutputGeneratorTests {
115112 warnings: [ ]
116113 )
117114
118- #expect ( output == expectedOutput)
115+ XCTAssertEqual ( output, expectedOutput)
119116 }
120117
121118 struct AllTargetsExpectation {
122119 let allTargets : [ String ] ?
123120 let expectedTitle : String
124121 let expectedTargetSection : String
125122 }
126-
127- @ Test (
128- " allTargets should change the output as expected " ,
129- arguments : [
130- AllTargetsExpectation (
123+
124+ func test_allTargets_shouldChangeOutputAsExpected ( ) {
125+
126+ let testExpectations : [ AllTargetsExpectation ] = [
127+ . init (
131128 allTargets: [ ] ,
132129 expectedTitle: " ‼️ No analyzable targets detected " ,
133130 expectedTargetSection: " "
134131 ) ,
135- AllTargetsExpectation (
132+ . init (
136133 allTargets: nil ,
137134 expectedTitle: " ✅ No changes detected " ,
138135 expectedTargetSection: " "
139136 ) ,
140- AllTargetsExpectation (
137+ . init (
141138 allTargets: [ " SomeTarget " ] ,
142139 expectedTitle: " ✅ No changes detected " ,
143140 expectedTargetSection: " \n **Analyzed targets:** SomeTarget "
144141 )
145142 ]
146- )
147- func allTargets_shouldChangeOutputAsExpected( argument: AllTargetsExpectation ) {
143+
144+ testExpectations. forEach { argument in
145+ allTargets_shouldChangeOutputAsExpected ( argument: argument)
146+ }
147+ }
148+
149+ private func allTargets_shouldChangeOutputAsExpected( argument: AllTargetsExpectation ) {
148150
149151 let expectedOutput = """
150152 # \( argument. expectedTitle)
@@ -163,6 +165,6 @@ class OutputGeneratorTests {
163165 warnings: [ ]
164166 )
165167
166- #expect ( output == expectedOutput)
168+ XCTAssertEqual ( output, expectedOutput)
167169 }
168170}
0 commit comments