Skip to content

Commit fb946cf

Browse files
committed
[Tests] Add test coverage of building an empty dependency.
1 parent da82f4c commit fb946cf

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "HasEmptyDependency",
5+
dependencies: [
6+
.Package(url: "../EmptyWithDependency", majorVersion: 1),
7+
])

Fixtures/Miscellaneous/ExactDependencies/HasEmptyDependency/main.swift

Whitespace-only changes.

Tests/Functional/MiscellaneousTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ class MiscellaneousTestCase: XCTestCase {
4848
}
4949
}
5050

51+
func testPackageWithEmptyDependency() throws {
52+
// Tests a package with an empty dependency fails (we only allow it in the root package).
53+
fixture(name: "Miscellaneous/ExactDependencies") { prefix in
54+
XCTAssertBuildFails(prefix.appending("HasEmptyDependency"))
55+
}
56+
}
57+
5158
func testManifestExcludes1() {
5259

5360
// Tests exclude syntax where no target customization is specified
@@ -382,6 +389,7 @@ class MiscellaneousTestCase: XCTestCase {
382389
("testPrintsSelectedDependencyVersion", testPrintsSelectedDependencyVersion),
383390
("testPackageWithNoSources", testPackageWithNoSources),
384391
("testPackageWithNoSourcesButDependency", testPackageWithNoSourcesButDependency),
392+
("testPackageWithEmptyDependency", testPackageWithEmptyDependency),
385393
("testManifestExcludes1", testManifestExcludes1),
386394
("testManifestExcludes2", testManifestExcludes2),
387395
("testManifestExcludes3", testManifestExcludes3),

0 commit comments

Comments
 (0)