Skip to content

Commit ba69421

Browse files
hartbitaciidgh
authored andcommitted
Enable the PubGrub resolver in tests by default
1 parent 8986845 commit ba69421

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Sources/SPMTestSupport/TestWorkspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public final class TestWorkspace {
3838
packages: [TestPackage],
3939
toolsVersion: ToolsVersion = ToolsVersion.currentToolsVersion,
4040
skipUpdate: Bool = false,
41-
enablePubGrub: Bool = false
41+
enablePubGrub: Bool = true
4242
) throws {
4343
self.sandbox = sandbox
4444
self.fs = fs

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import TSCUtility
2121
import SPMTestSupport
2222

2323
final class WorkspaceTests: XCTestCase {
24-
2524
func testBasics() throws {
2625
let sandbox = AbsolutePath("/tmp/ws/")
2726
let fs = InMemoryFileSystem()
@@ -743,7 +742,7 @@ final class WorkspaceTests: XCTestCase {
743742
]
744743
workspace.checkPackageGraph(deps: deps) { (_, diagnostics) in
745744
DiagnosticsEngineTester(diagnostics) { result in
746-
result.check(diagnostic: .contains("the package dependency graph could not be resolved; possibly because of these requirements"), behavior: .error)
745+
result.check(diagnostic: .contains("version solving failed"), behavior: .error)
747746
}
748747
}
749748
// There should be no extra fetches.
@@ -1412,7 +1411,7 @@ final class WorkspaceTests: XCTestCase {
14121411
// Check failure.
14131412
workspace.checkResolve(pkg: "Foo", roots: ["Root"], version: "1.3.0") { diagnostics in
14141413
DiagnosticsEngineTester(diagnostics) { result in
1415-
result.check(diagnostic: .contains("tmp/ws/pkgs/Foo @ 1.3.0"), behavior: .error)
1414+
result.check(diagnostic: .contains("Foo 1.3.0"), behavior: .error)
14161415
}
14171416
}
14181417
workspace.checkManagedDependencies() { result in
@@ -1505,7 +1504,7 @@ final class WorkspaceTests: XCTestCase {
15051504

15061505
workspace.checkPackageGraph(roots: ["Root"]) { (graph, diagnostics) in
15071506
DiagnosticsEngineTester(diagnostics) { result in
1508-
result.check(diagnostic: .contains("/tmp/ws/pkgs/Foo @ 1.0.0..<2.0.0"), behavior: .error)
1507+
result.check(diagnostic: .contains("Foo 1.0.0..<2.0.0"), behavior: .error)
15091508
}
15101509
}
15111510
}
@@ -2070,7 +2069,7 @@ final class WorkspaceTests: XCTestCase {
20702069
]
20712070
workspace.checkPackageGraph(roots: ["Root"], deps: deps) { (_, diagnostics) in
20722071
DiagnosticsEngineTester(diagnostics) { result in
2073-
result.check(diagnostic: .contains("/tmp/ws/pkgs/Bar @ 1.1.0"), behavior: .error)
2072+
result.check(diagnostic: .contains("Bar 1.1.0"), behavior: .error)
20742073
}
20752074
}
20762075
}
@@ -2256,7 +2255,7 @@ final class WorkspaceTests: XCTestCase {
22562255
result.check(targets: "Foo")
22572256
}
22582257
DiagnosticsEngineTester(diagnostics) { result in
2259-
result.check(diagnostic: .contains("1.5.0 contains incompatible dependencies"), behavior: .error)
2258+
result.check(diagnostic: .contains("Bar {1.0.0..<1.5.0, 1.5.1..<2.0.0} is forbidden"), behavior: .error)
22602259
}
22612260
}
22622261
}
@@ -3300,8 +3299,7 @@ final class WorkspaceTests: XCTestCase {
33003299
],
33013300
versions: ["1.0.0", nil]
33023301
),
3303-
],
3304-
enablePubGrub: true
3302+
]
33053303
)
33063304

33073305
// Load the graph.

0 commit comments

Comments
 (0)