From 1ad20421e9b5f0a5ff0ec70e4753126003a0f5b9 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Thu, 7 Dec 2017 15:50:55 -0800 Subject: [PATCH] Move Windows-specific path test into its own file --- src/pathext.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pathext.rs b/src/pathext.rs index b6a6f30b..1fd49a80 100644 --- a/src/pathext.rs +++ b/src/pathext.rs @@ -33,6 +33,15 @@ fn test_path_to_route() { t(Path::new("/a/b/c"), Path::new("/a/b/c/d"), Some(vec!["d".to_string()])); t(Path::new("/a/b"), Path::new("a"), None); +} + +#[test] +#[cfg(target_os = "windows")] +fn test_path_to_route_windows() { + fn t(root: &Path, value: &Path, result: Option>) { + assert_eq!(path_to_route(root, value), result); + } + t(Path::new("C:\\foo"), Path::new("C:\\foo\\bar\\baz"), Some(vec!["bar".to_string(), "baz".to_string()])); }