test(runtime): gate the Windows extended-path boundary test to Windows

accepts_equivalent_extended_path_at_workspace_boundary builds its paths
with backslash separators. Backslashes only separate path components on
Windows, so on Linux each path is a single component, the boundary check
rejects the path, and cargo test fails.

Run the test only on Windows, and call validate_workspace_boundary through
super:: so non-Windows test builds do not warn about an unused import.
This commit is contained in:
Suliman Abdulrazzaq committed 2026-09-17 13:15:05 +00:00
1 parent 9e7fd601a5
commit dbf5389729
1 file changed
+5 -3
+5 -3
View File
@@ -800,8 +800,8 @@ mod tests {
use super::{
component_contains_glob, derive_glob_walk_root, edit_file, expand_braces, glob_search,
grep_search, is_symlink_escape, normalize_for_comparison, read_file,
read_file_in_workspace, validate_workspace_boundary, write_file, write_file_in_workspace,
GrepSearchInput, MAX_WRITE_SIZE,
read_file_in_workspace, write_file, write_file_in_workspace, GrepSearchInput,
MAX_WRITE_SIZE,
};
fn temp_path(name: &str) -> std::path::PathBuf {
@@ -948,11 +948,13 @@ mod tests {
);
}
// Backslash-separated paths only parse into path components on Windows.
#[test]
#[cfg(windows)]
fn accepts_equivalent_extended_path_at_workspace_boundary() {
let root = PathBuf::from(r"C:\workspace");
let resolved = PathBuf::from(r"\\?\C:\workspace\src\main.rs");
validate_workspace_boundary(&resolved, &root)
super::validate_workspace_boundary(&resolved, &root)
.expect("equivalent Windows path representations should be accepted");
}