test(mcp): compare the #2134 root with forward slashes on Windows

tool_index_repository_reuses_existing_project_for_root_issue2134 counts
how often the canonical repo root occurs in list_projects. On Windows,
cbm_canonical_path returns "C:\Users\...", while the stored root_path is
"C:/Users/...", so the count was 0 and the test failed on the CLANG64
leg (test_mcp.c:8448: owners == 0, expected 1).

Normalize the expected root with cbm_normalize_path_sep, a no-op on
POSIX, before counting.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel committed 2026-09-30 22:26:34 +02:00
1 parent 1f0daaa915
commit 364dd6a99b
1 file changed
+2
+2
View File
@@ -8626,6 +8626,8 @@ TEST(tool_index_repository_reuses_existing_project_for_root_issue2134) {
if (!cbm_canonical_path(repo, canonical_repo, sizeof(canonical_repo))) {
FAIL("cbm_canonical_path failed");
}
/* Stored root_path values use forward slashes on every platform. */
cbm_normalize_path_sep(canonical_repo);
const char *saved_cache = getenv("CBM_CACHE_DIR");
char *saved_cache_copy = saved_cache ? cbm_strdup(saved_cache) : NULL;
const char *saved_sup = getenv("CBM_INDEX_SUPERVISOR");