@@ -132,12 +132,12 @@ class ReconcilerTests: AppTestCase {
132132 func test_reconcileCustomCollections( ) async throws {
133133 // Test single custom collection reconciliation
134134 // setup
135- var fullPackageList = [ URL ( " a " ) , URL ( " b " ) , URL ( " c " ) ]
135+ var fullPackageList = [ URL ( " https://github.com/a.git " ) , URL ( " https://github.com/b.git " ) , URL ( " https://github.com/c.git " ) ]
136136 for url in fullPackageList { try await Package ( url: url) . save ( on: app. db) }
137137
138138 // Initial run
139139 try await withDependencies {
140- $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " b " ) ] }
140+ $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " https://github.com/b.git " ) ] }
141141 } operation: {
142142 // MUT
143143 try await reconcileCustomCollection ( client: app. client,
@@ -150,12 +150,12 @@ class ReconcilerTests: AppTestCase {
150150 XCTAssertEqual ( count, 1 )
151151 let collection = try await CustomCollection . query ( on: app. db) . first ( ) . unwrap ( )
152152 try await collection. $packages. load ( on: app. db)
153- XCTAssertEqual ( collection. packages. map ( \. url) , [ " b " ] )
153+ XCTAssertEqual ( collection. packages. map ( \. url) , [ " https://github.com/b.git " ] )
154154 }
155155
156156 // Reconcile again with an updated list of packages in the collection
157157 try await withDependencies {
158- $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " c " ) ] }
158+ $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " https://github.com/c.git " ) ] }
159159 } operation: {
160160 // MUT
161161 try await reconcileCustomCollection ( client: app. client,
@@ -168,14 +168,14 @@ class ReconcilerTests: AppTestCase {
168168 XCTAssertEqual ( count, 1 )
169169 let collection = try await CustomCollection . query ( on: app. db) . first ( ) . unwrap ( )
170170 try await collection. $packages. load ( on: app. db)
171- XCTAssertEqual ( collection. packages. map ( \. url) , [ " c " ] )
171+ XCTAssertEqual ( collection. packages. map ( \. url) , [ " https://github.com/c.git " ] )
172172 }
173173
174174 // Re-run after the single package in the list has been deleted in the full package list
175- fullPackageList = [ URL ( " a " ) , URL ( " b " ) ]
176- try await Package . query ( on: app. db) . filter ( by: URL ( " c " ) ) . first ( ) ? . delete ( on: app. db)
175+ fullPackageList = [ URL ( " https://github.com/a.git " ) , URL ( " https://github.com/b.git " ) ]
176+ try await Package . query ( on: app. db) . filter ( by: URL ( " https://github.com/c.git " ) ) . first ( ) ? . delete ( on: app. db)
177177 try await withDependencies {
178- $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " c " ) ] }
178+ $0. packageListRepository. fetchCustomCollection = { @Sendable _, _ in [ URL ( " https://github.com/c.git " ) ] }
179179 } operation: {
180180 // MUT
181181 try await reconcileCustomCollection ( client: app. client,
@@ -195,7 +195,7 @@ class ReconcilerTests: AppTestCase {
195195 func test_reconcileCustomCollections_limit( ) async throws {
196196 // Test custom collection reconciliation size limit
197197 // setup
198- let fullPackageList = ( 1 ... 60 ) . map { URL ( string: " \( $0) " ) ! }
198+ let fullPackageList = ( 1 ... 60 ) . map { URL ( string: " https://github.com/ \( $0) .git " ) ! }
199199 for url in fullPackageList { try await Package ( url: url) . save ( on: app. db) }
200200
201201 try await withDependencies {
@@ -213,21 +213,21 @@ class ReconcilerTests: AppTestCase {
213213 let collection = try await CustomCollection . query ( on: app. db) . first ( ) . unwrap ( )
214214 try await collection. $packages. load ( on: app. db)
215215 XCTAssertEqual ( collection. packages. count, 50 )
216- XCTAssertEqual ( collection. packages. first? . url, " 1 " )
217- XCTAssertEqual ( collection. packages. last? . url, " 50 " )
216+ XCTAssertEqual ( collection. packages. first? . url, " https://github.com/1.git " )
217+ XCTAssertEqual ( collection. packages. last? . url, " https://github.com/50.git " )
218218 }
219219 }
220220
221221 func test_reconcile( ) async throws {
222- let fullPackageList = ( 1 ... 3 ) . map { URL ( string: " \( $0) " ) ! }
222+ let fullPackageList = ( 1 ... 3 ) . map { URL ( string: " https://github.com/ \( $0) .git " ) ! }
223223 struct TestError : Error { var message : String }
224224
225225 try await withDependencies {
226226 $0. packageListRepository. fetchPackageList = { @Sendable _ in fullPackageList }
227227 $0. packageListRepository. fetchPackageDenyList = { @Sendable _ in [ ] }
228228 $0. packageListRepository. fetchCustomCollection = { @Sendable _, url in
229229 if url == " collectionURL " {
230- return [ URL ( " 2 " ) ]
230+ return [ URL ( " https://github.com/2.git " ) ]
231231 } else {
232232 throw TestError ( message: " collection not found: \( url) " )
233233 }
@@ -249,7 +249,7 @@ class ReconcilerTests: AppTestCase {
249249 XCTAssertEqual ( collection. name, " List " )
250250 XCTAssertEqual ( collection. url, " collectionURL " )
251251 try await collection. $packages. load ( on: app. db)
252- XCTAssertEqual ( collection. packages. map ( \. url) , [ " 2 " ] )
252+ XCTAssertEqual ( collection. packages. map ( \. url) , [ " https://github.com/2.git " ] )
253253 }
254254 }
255255
0 commit comments