@@ -267,14 +267,10 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
267
267
configuration. defaultRegistry = Registry ( url: registryURL, supportsAvailability: false )
268
268
269
269
let registryClient = makeRegistryClient ( configuration: configuration, httpClient: httpClient)
270
+
270
271
task = Task {
271
- do {
272
- _ = try await registryClient. getPackageMetadata ( package : identity)
273
- Issue . record ( " Task completed without being cancelled " )
274
- } catch let error where error is _Concurrency . CancellationError {
275
- // OK
276
- } catch {
277
- Issue . record ( " Task failed with unexpected error: \( error) " )
272
+ await #expect( throws: _Concurrency. CancellationError. self) {
273
+ try await registryClient. getPackageMetadata ( package : identity)
278
274
}
279
275
}
280
276
@@ -1304,7 +1300,8 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1304
1300
}
1305
1301
}
1306
1302
1307
- @Test func getManifestContentWithOptionalContentVersion( ) async throws {
1303
+ @Test ( arguments: [ ToolsVersion . v5_3, nil ] )
1304
+ func getManifestContentWithOptionalContentVersion( toolsVersion: ToolsVersion ? ) async throws {
1308
1305
let checksumAlgorithm : HashAlgorithm = MockHashAlgorithm ( )
1309
1306
let checksum = checksumAlgorithm. hash ( emptyZipFile) . hexadecimalRepresentation
1310
1307
@@ -1392,20 +1389,10 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1392
1389
let manifest = try await registryClient. getManifestContent (
1393
1390
package : identity,
1394
1391
version: version,
1395
- customToolsVersion: nil
1396
- )
1397
- let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1398
- #expect( parsedToolsVersion == . current)
1399
- }
1400
-
1401
- do {
1402
- let manifest = try await registryClient. getManifestContent (
1403
- package : identity,
1404
- version: version,
1405
- customToolsVersion: . v5_3
1392
+ customToolsVersion: toolsVersion
1406
1393
)
1407
1394
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1408
- #expect( parsedToolsVersion == . v5_3 )
1395
+ #expect( parsedToolsVersion == toolsVersion ?? . current )
1409
1396
}
1410
1397
}
1411
1398
0 commit comments