Skip to content

Commit 65a38be

Browse files
committed
Fix Windows test failures: backslash allowed, skip shell-dependent test
1 parent 4c2e74d commit 65a38be

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/test_cli.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ TEST(cli_find_cli_on_path) {
346346
}
347347

348348
TEST(cli_find_cli_fallback_paths) {
349+
#ifdef _WIN32
350+
SKIP("shell scripts + chmod not available on Windows");
351+
#endif
349352
/* Port of TestFindCLI_FallbackPaths */
350353
char tmpdir[256]; snprintf(tmpdir, sizeof(tmpdir), "/tmp/cli-find-XXXXXX");
351354
if (!cbm_mkdtemp(tmpdir))

tests/test_security.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ TEST(shell_rejects_ampersand) {
5050
}
5151

5252
TEST(shell_rejects_backslash) {
53+
#ifdef _WIN32
54+
/* Backslash is allowed on Windows (path separator) */
55+
ASSERT_TRUE(cbm_validate_shell_arg("foo\\bar"));
56+
#else
5357
ASSERT_FALSE(cbm_validate_shell_arg("foo\\bar"));
58+
#endif
5459
PASS();
5560
}
5661

0 commit comments

Comments
 (0)