@@ -1190,8 +1190,12 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1190
1190
}
1191
1191
1192
1192
@Suite ( " Manifest Content " ) struct ManifestContent {
1193
- @Test ( arguments: [ ToolsVersion . v5_3, . v4, nil ] )
1194
- func getManifestContent( toolsVersion: ToolsVersion ? ) async throws {
1193
+ @Test ( arguments: [
1194
+ ( toolsVersion: ToolsVersion . v5_3, expectedToolsVersion: ToolsVersion . v5_3) ,
1195
+ ( toolsVersion: ToolsVersion . v4, expectedToolsVersion: ToolsVersion . v4) ,
1196
+ ( toolsVersion: nil , expectedToolsVersion: ToolsVersion . current)
1197
+ ] )
1198
+ func getManifestContent( toolsVersion: ToolsVersion ? , expectedToolsVersion: ToolsVersion ) async throws {
1195
1199
let checksumAlgorithm : HashAlgorithm = MockHashAlgorithm ( )
1196
1200
let checksum = checksumAlgorithm. hash ( emptyZipFile) . hexadecimalRepresentation
1197
1201
@@ -1282,7 +1286,7 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1282
1286
customToolsVersion: toolsVersion
1283
1287
)
1284
1288
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1285
- #expect( parsedToolsVersion == toolsVersion ?? . current )
1289
+ #expect( parsedToolsVersion == expectedToolsVersion )
1286
1290
}
1287
1291
1288
1292
do {
@@ -1296,12 +1300,15 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1296
1300
) { continuation. resume ( with: $0) }
1297
1301
}
1298
1302
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifestSync)
1299
- #expect( parsedToolsVersion == toolsVersion ?? . current )
1303
+ #expect( parsedToolsVersion == expectedToolsVersion )
1300
1304
}
1301
1305
}
1302
1306
1303
- @Test ( arguments: [ ToolsVersion . v5_3, nil ] )
1304
- func getManifestContentWithOptionalContentVersion( toolsVersion: ToolsVersion ? ) async throws {
1307
+ @Test ( arguments: [
1308
+ ( toolsVersion: ToolsVersion . v5_3, expectedToolsVersion: ToolsVersion . v5_3) ,
1309
+ ( toolsVersion: nil , expectedToolsVersion: ToolsVersion . current)
1310
+ ] )
1311
+ func getManifestContentWithOptionalContentVersion( toolsVersion: ToolsVersion ? , expectedToolsVersion: ToolsVersion ) async throws {
1305
1312
let checksumAlgorithm : HashAlgorithm = MockHashAlgorithm ( )
1306
1313
let checksum = checksumAlgorithm. hash ( emptyZipFile) . hexadecimalRepresentation
1307
1314
@@ -1392,12 +1399,15 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1392
1399
customToolsVersion: toolsVersion
1393
1400
)
1394
1401
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1395
- #expect( parsedToolsVersion == toolsVersion ?? . current )
1402
+ #expect( parsedToolsVersion == expectedToolsVersion )
1396
1403
}
1397
1404
}
1398
1405
1399
- @Test ( arguments: [ ToolsVersion . v5_3, nil ] )
1400
- func getManifestContentMatchingChecksumInStorage( toolsVersion: ToolsVersion ? ) async throws {
1406
+ @Test ( arguments: [
1407
+ ( toolsVersion: ToolsVersion . v5_3, expectedToolsVersion: ToolsVersion . v5_3) ,
1408
+ ( toolsVersion: nil , expectedToolsVersion: ToolsVersion . current)
1409
+ ] )
1410
+ func getManifestContentMatchingChecksumInStorage( toolsVersion: ToolsVersion ? , expectedToolsVersion: ToolsVersion ) async throws {
1401
1411
let checksumAlgorithm : HashAlgorithm = MockHashAlgorithm ( )
1402
1412
let checksum = checksumAlgorithm. hash ( emptyZipFile) . hexadecimalRepresentation
1403
1413
@@ -1507,7 +1517,7 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1507
1517
customToolsVersion: toolsVersion
1508
1518
)
1509
1519
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1510
- #expect( parsedToolsVersion == toolsVersion ?? . current )
1520
+ #expect( parsedToolsVersion == expectedToolsVersion )
1511
1521
}
1512
1522
}
1513
1523
@@ -1625,8 +1635,11 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1625
1635
}
1626
1636
}
1627
1637
1628
- @Test ( arguments: [ ToolsVersion . v5_3, nil ] )
1629
- func getManifestContentWithNonMatchingChecksumInStorage_warn( toolsVersion: ToolsVersion ? ) async throws {
1638
+ @Test ( arguments: [
1639
+ ( toolsVersion: ToolsVersion . v5_3, expectedToolsVersion: ToolsVersion . v5_3) ,
1640
+ ( toolsVersion: nil , expectedToolsVersion: ToolsVersion . current)
1641
+ ] )
1642
+ func getManifestContentWithNonMatchingChecksumInStorage_warn( toolsVersion: ToolsVersion ? , expectedToolsVersion: ToolsVersion ) async throws {
1630
1643
let checksumAlgorithm : HashAlgorithm = MockHashAlgorithm ( )
1631
1644
let checksum = checksumAlgorithm. hash ( emptyZipFile) . hexadecimalRepresentation
1632
1645
@@ -1742,7 +1755,7 @@ fileprivate var availabilityURL = URL("\(registryURL)/availability")
1742
1755
}
1743
1756
1744
1757
let parsedToolsVersion = try ToolsVersionParser . parse ( utf8String: manifest)
1745
- #expect( parsedToolsVersion == toolsVersion ?? . current )
1758
+ #expect( parsedToolsVersion == expectedToolsVersion )
1746
1759
}
1747
1760
}
1748
1761
0 commit comments