From ef3d55cdbc52b03fd3e7e9ffb95d6127155c661d Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Sat, 17 Dec 2016 20:11:56 -0800 Subject: [PATCH] Fix broken test on Linux --- src/config.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 005888d..a0f0fc4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -209,7 +209,14 @@ fn test_clean_path_string() { } correct_path.push("some"); correct_path.push("path"); - assert_eq!(correct_path, clean_path_string(r#"C:/some/path"#)); - assert_eq!(correct_path, clean_path_string(r#"C:\some\path"#)); - assert_eq!(correct_path, clean_path_string(r#"C:\some\path\"#)); + if cfg!(target_os = "windows") { + assert_eq!(correct_path, clean_path_string(r#"C:/some/path"#)); + assert_eq!(correct_path, clean_path_string(r#"C:\some\path"#)); + assert_eq!(correct_path, clean_path_string(r#"C:\some\path\"#)); + } else { + assert_eq!(correct_path, clean_path_string(r#"/usr/some/path"#)); + assert_eq!(correct_path, clean_path_string(r#"/usr\some\path"#)); + assert_eq!(correct_path, clean_path_string(r#"/usr\some\path\"#)); + } + }