Skip to content

Commit

Permalink
Add test case for issue #2973
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Oct 31, 2024
1 parent 7a50f4c commit 030f2a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/dub/test/dependencies.d
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
17 changes: 17 additions & 0 deletions source/dub/test/subpackages.d
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

0 comments on commit 030f2a2

Please sign in to comment.