Fix Windows test failures: backslash allowed, skip shell-dependent test

This commit is contained in:
Martin Vogel committed 2026-03-25 10:12:44 +01:00
1 parent 4c2e74dc99
commit 65a38be478
2 files changed
+8

No files matched your search

+3
View File
@@ -346,6 +346,9 @@ TEST(cli_find_cli_on_path) {
}
TEST(cli_find_cli_fallback_paths) {
#ifdef _WIN32
SKIP("shell scripts + chmod not available on Windows");
#endif
/* Port of TestFindCLI_FallbackPaths */
char tmpdir[256]; snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-find-XXXXXX");
if (!cbm_mkdtemp(tmpdir))
+5
View File
@@ -50,7 +50,12 @@ TEST(shell_rejects_ampersand) {
}
TEST(shell_rejects_backslash) {
#ifdef _WIN32
/* Backslash is allowed on Windows (path separator) */
ASSERT_TRUE(cbm_validate_shell_arg("foo\\bar"));
#else
ASSERT_FALSE(cbm_validate_shell_arg("foo\\bar"));
#endif
PASS();
}