Skip to content

Commit de422af

Browse files
committed
tests: gate forward-slash+full-path test off Windows
Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com> On Windows the regex-over-full-path match uses `\`, so the pattern `one/two/c` cannot match a real entry. The diagnostic- didn't-fire behaviour this test pins is already covered by the fact that the invocation does not error. Gate it to non-Windows per tmccombs's CI feedback on the PR.
1 parent 4f4900b commit de422af

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/tests.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,14 @@ fn test_pattern_with_forward_slash_is_rejected() {
399399
/// --full-path is the user's explicit opt-in to regex-over-full-path matching,
400400
/// so a path-separation character in the pattern is expected and must not
401401
/// trigger the diagnostic.
402+
///
403+
/// Gated off Windows: the actual match is regex-over-the-full-path, so a
404+
/// forward-slash pattern only matches Unix-style paths. On Windows the OS
405+
/// uses `\` and `one/two/c` (as a literal regex) does not match a real
406+
/// entry — the behaviour this test is pinning (the diagnostic does not
407+
/// fire) is covered by the fact that the invocation does not error.
402408
#[test]
409+
#[cfg(not(windows))]
403410
fn test_pattern_with_forward_slash_allowed_with_full_path() {
404411
let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES);
405412

0 commit comments

Comments
 (0)