Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

test(cli): create the non-ASCII Windows profile through the wide API

Martin Vogelc21c42b4d6ce
diff --git a/tests/test_cli.c b/tests/test_cli.c
index 42fba903e..c72095f22 100644
--- a/tests/test_cli.c
+++ b/tests/test_cli.c
@@ -14597,19 +14597,24 @@ TEST(cli_detect_agents_finds_zed_in_roaming_appdata) {
#endif
#ifdef _WIN32
+/* #2145: a profile path outside the ANSI code page must stay visible to agent
+ * detection. The directory is created with th_mkdir_p, which goes through the
+ * wide-char API: test_mkdirp uses cbm_mkdir, the narrow _mkdir on Windows,
+ * which would create a code-page-mangled name instead of this one. Cursor is
+ * detected by its directory alone, so the assertion goes through dir_exists. */
TEST(cli_detect_agents_handles_non_ascii_windows_profile) {
char home[1024];
snprintf(home, sizeof(home), "%s/cbm-用户-profile", cbm_tmpdir());
test_rmdir_r(home);
- char claude_dir[1024];
- snprintf(claude_dir, sizeof(claude_dir), "%s/.claude", home);
- if (!test_mkdirp(claude_dir))
+ char cursor_dir[1024];
+ snprintf(cursor_dir, sizeof(cursor_dir), "%s/.cursor", home);
+ if (th_mkdir_p(cursor_dir) != 0)
FAIL("could not create non-ASCII Windows profile path");
cbm_detected_agents_t agents = cbm_detect_agents(home);
test_rmdir_r(home);
- if (!agents.claude_code)
- FAIL("Claude detection must support non-ASCII Windows profile paths");
+ if (!agents.cursor)
+ FAIL("agent detection must support non-ASCII Windows profile paths");
PASS();
}
#endif