-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathPD_5_5_LoadingTests.swift
67 lines (59 loc) · 2.34 KB
/
PD_5_5_LoadingTests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
This source file is part of the Swift.org open source project
Copyright (c) 2021 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See http://swift.org/LICENSE.txt for license information
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import XCTest
import TSCBasic
import TSCUtility
import SPMTestSupport
import PackageModel
import PackageLoading
class PackageDescription5_5LoadingTests: PackageDescriptionLoadingTests {
override var toolsVersion: ToolsVersion {
.v5_5
}
func testPackageDependencies() throws {
let manifest = """
import PackageDescription
let package = Package(
name: "Foo",
dependencies: [
.package(url: "/foo5", branch: "main"),
.package(url: "/foo7", revision: "58e9de4e7b79e67c72a46e164158e3542e570ab6"),
]
)
"""
loadManifest(manifest, toolsVersion: .v5_5) { manifest in
let deps = Dictionary(uniqueKeysWithValues: manifest.dependencies.map{ ($0.identity.description, $0) })
XCTAssertEqual(deps["foo5"], .scm(location: "/foo5", requirement: .branch("main")))
XCTAssertEqual(deps["foo7"], .scm(location: "/foo7", requirement: .revision("58e9de4e7b79e67c72a46e164158e3542e570ab6")))
}
}
func testPlatforms() throws {
let stream = BufferedOutputByteStream()
stream <<< """
import PackageDescription
let package = Package(
name: "Foo",
platforms: [
.macOS(.v12), .iOS(.v15),
.tvOS(.v15), .watchOS(.v8),
.macCatalyst(.v15), .driverKit(.v21),
]
)
"""
loadManifest(stream.bytes) { manifest in
XCTAssertEqual(manifest.platforms, [
PlatformDescription(name: "macos", version: "12.0"),
PlatformDescription(name: "ios", version: "15.0"),
PlatformDescription(name: "tvos", version: "15.0"),
PlatformDescription(name: "watchos", version: "8.0"),
PlatformDescription(name: "maccatalyst", version: "15.0"),
PlatformDescription(name: "driverkit", version: "21.0"),
])
}
}
}