File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4021,7 +4021,11 @@ static void test_announce(const BuildContext& ctx) {
40214021 auto announce = [&](const std::string& name,
40224022 const mcpp::manifest::DependencySpec& spec,
40234023 std::string_view suffix) {
4024- std::string ver = spec.isPath () ? " (path)" : std::string (" v" ) + spec.version ;
4024+ // The resolved version, as the build's own banner reads it (mcpp#363):
4025+ // `spec.version` is the constraint as written (`^0.3.1`).
4026+ const auto resolved = ctx.resolvedVersions .find (name);
4027+ std::string ver = spec.isPath () ? " (path)"
4028+ : std::string (" v" ) + (resolved != ctx.resolvedVersions .end () ? resolved->second : spec.version );
40254029 auto it = cachedUnits.find (name);
40264030 if (it == cachedUnits.end ()) {
40274031 mcpp::ui::status (" Compiling" ,
Original file line number Diff line number Diff line change @@ -210,6 +210,9 @@ rm -f mcpp.lock
210210" $MCPP " build > c1.log 2>&1 || fail " build with a dev-dep failed" c1.log
211211cp mcpp.lock lock.build
212212" $MCPP " test > c2.log 2>&1 || fail " test with a dev-dep failed" c2.log
213+ # `mcpp test` announces the resolved version too, as the build's banner does.
214+ grep -q ' acme\.im v\^' c2.log \
215+ && fail " mcpp test announced a constraint as a version" c2.log
213216cmp -s mcpp.lock lock.build \
214217 || { diff lock.build mcpp.lock || true
215218 fail " mcpp test rewrote mcpp.lock — the lock must not depend on the command" ; }
You can’t perform that action at this time.
0 commit comments