Skip to content

Commit 4d9bea7

Browse files
committed
test: add check for windows-style paths
Since variants of type `Component::Prefix` does not occur on Unix according to the docs, I think these tests should be for Windows builds only, since here they fail as the paths seem to be OK though the validations are expected to fail.
1 parent b0a2400 commit 4d9bea7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

agent-control/src/agent_type/runtime_config/on_host/filesystem.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,12 @@ mod tests {
237237

238238
#[rstest]
239239
#[case::valid_filesystem_parse("basic/path", |r: Result<_, _>| r.is_ok())]
240+
#[case::windows_style_path(r"some\\windows\\style\\path", |r: Result<_, _>| r.is_ok())]
240241
#[case::invalid_absolute_path("/absolute/path", |r: Result<_, serde_yaml::Error>| r.is_err_and(|e| e.to_string().contains("absolute: /absolute/path")))]
241242
#[case::invalid_escapes_basedir("basedir/dir/../dir/../../../outdir/path", |r: Result<_, serde_yaml::Error>| r.is_err_and(|e| e.to_string().contains("escapes the base directory")))]
243+
// #[case::invalid_windows_path_prefix(r"C:\\absolute\\windows\\path", |r: Result<_, serde_yaml::Error>| r.is_err_and(|e| e.to_string().contains("invalid path component")))]
244+
// #[case::invalid_windows_root_device("C:", |r: Result<_, serde_yaml::Error>| r.is_err_and(|e| e.to_string().contains("invalid path component")))]
245+
// #[case::invalid_windows_server_path(r"\\\\server\\share", |r: Result<_, serde_yaml::Error>| r.is_err_and(|e| e.to_string().contains("invalid path component")))]
242246
// TODO add windows paths to check that this handles the `Component::Prefix(_)` case correctly
243247
fn file_entry_parsing(
244248
#[case] path: &str,

0 commit comments

Comments
 (0)