Skip to content

Commit b591a00

Browse files
committed
test(pm): lock read_seeded_index_repos tolerance to artifact/source fields
1 parent 7a1020e commit b591a00

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎tests/unit/test_pm_package_fetcher.cpp‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,3 +253,25 @@ TEST(PmPackageFetcher, ReadSeededIndexReposParsesXlingsJson) {
253253

254254
std::filesystem::remove_all(project);
255255
}
256+
257+
TEST(PmPackageFetcher, ReadSeededIndexReposToleratesArtifactFields) {
258+
// #269: entries seeded with per-repo artifact/source keys (xlings >=
259+
// 0.4.68) must still yield name+url — regression lock for the hand-
260+
// rolled index_repos reader.
261+
auto project = make_tempdir("mcpp-269-artifact-fields");
262+
auto xjson = project / ".xlings.json";
263+
write_file(xjson, R"({
264+
"index_repos": [
265+
{ "name": "mcpplibs", "url": "https://github.com/mcpplibs/mcpp-index.git", "artifact": "https://github.com/xlings-res/mcpp-index", "source": "auto" }
266+
],
267+
"lang": "en"
268+
})");
269+
270+
auto repos = mcpp::pm::read_seeded_index_repos(xjson);
271+
ASSERT_EQ(repos.size(), 1u);
272+
EXPECT_NE(repos[0].find("mcpplibs"), std::string::npos);
273+
EXPECT_NE(repos[0].find("https://github.com/mcpplibs/mcpp-index.git"),
274+
std::string::npos);
275+
276+
std::filesystem::remove_all(project);
277+
}

0 commit comments

Comments
 (0)