diff --git a/source/dub/test/dependencies.d b/source/dub/test/dependencies.d index 4b31f7dc3..39c13faf9 100644 --- a/source/dub/test/dependencies.d +++ b/source/dub/test/dependencies.d @@ -98,7 +98,7 @@ version "1.0.0"`, PackageFormat.sdl); assert(dub.project.hasAllDependencies(), "project has missing dependencies"); assert(dub.project.getDependency("b", true), "Missing 'b' dependency"); assert(dub.project.getDependency("c", true), "Missing 'c' dependency"); - assert(dub.project.getDependency("c", true), "Missing 'd' dependency"); + assert(dub.project.getDependency("d", true), "Missing 'd' dependency"); assert(dub.project.getDependency("no", true) is null, "Returned unexpected dependency"); } diff --git a/source/dub/test/subpackages.d b/source/dub/test/subpackages.d index a56ac0c3e..f1e1104a2 100644 --- a/source/dub/test/subpackages.d +++ b/source/dub/test/subpackages.d @@ -38,3 +38,20 @@ unittest assert(!dub.packageManager().getPackage(PackageName("b:b"), Version("1.1.0"))); } + +// https://github.com/dlang/dub/issues/2973 +unittest +{ + scope dub = new TestDub((scope Filesystem root) { + root.writeFile(TestDub.ProjectPath ~ "dub.json", + `{ "name": "a", "dependencies": { "b:a": "~>1.0" } }`); + root.writeFile(TestDub.ProjectPath ~ "dub.selections.json", + `{ "fileVersion": 1, "versions": { "b": "1.0.0" } }`); + root.writePackageFile("b", "1.0.0", + `{ "name": "b", "version": "1.0.0", "subPackages": [ { "name": "a" } ] }`); + }); + dub.loadPackage(); + + assert(dub.project.hasAllDependencies(), "project has missing dependencies"); + assert(dub.project.getDependency("b:a", true), "Missing 'b:a' dependency"); +}