diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-07-22 10:50:29 +0800 |
---|---|---|
committer | Sebastian Thiel <sebastian.thiel@icloud.com> | 2020-07-22 10:50:29 +0800 |
commit | 4812206eab68ea5588d93f9ea0589f9e772ee5ad (patch) | |
tree | f8ecdd252c2468fce2c83cec7a8b6862f7c8d326 | |
parent | ed1f91b42890998b255567f32e8049a842552937 (diff) | |
parent | 5a36cd18a31ca1fbdc62d4e594933a6327fe4e7d (diff) |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | src/interactive/app_test/unit.rs | 4 | ||||
-rw-r--r-- | src/interactive/app_test/utils.rs | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/interactive/app_test/unit.rs b/src/interactive/app_test/unit.rs index 320267d..e27d456 100644 --- a/src/interactive/app_test/unit.rs +++ b/src/interactive/app_test/unit.rs @@ -4,8 +4,6 @@ use crate::interactive::app_test::utils::{ use anyhow::Result; use pretty_assertions::assert_eq; -// Won't work on windows as there are backslashes in the paths :D -#[cfg_attr(windows, ignore)] #[test] fn it_can_handle_ending_traversal_reaching_top_but_skipping_levels() -> Result<()> { let (_, app) = initialized_app_and_terminal_from_fixture(&["sample-01"])?; @@ -19,8 +17,6 @@ fn it_can_handle_ending_traversal_reaching_top_but_skipping_levels() -> Result<( Ok(()) } -// Won't work on windows as there are backslashes in the paths :D -#[cfg_attr(windows, ignore)] #[test] fn it_can_handle_ending_traversal_without_reaching_the_top() -> Result<()> { let (_, app) = initialized_app_and_terminal_from_fixture(&["sample-02"])?; diff --git a/src/interactive/app_test/utils.rs b/src/interactive/app_test/utils.rs index a42f36b..454acc2 100644 --- a/src/interactive/app_test/utils.rs +++ b/src/interactive/app_test/utils.rs @@ -211,7 +211,10 @@ pub fn sample_01_tree() -> Tree { let mut t = Tree::new(); { let mut add_node = make_add_node(&mut t); + #[cfg(not(windows))] let root_size = 1259070; + #[cfg(windows)] + let root_size = 1259069; let r = add_node("", root_size, None); { let s = add_node(&fixture_str("sample-01"), root_size, Some(r)); @@ -219,7 +222,10 @@ pub fn sample_01_tree() -> Tree { add_node(".hidden.666", 666, Some(s)); add_node("a", 256, Some(s)); add_node("b.empty", 0, Some(s)); + #[cfg(not(windows))] add_node("c.lnk", 1, Some(s)); + #[cfg(windows)] + add_node("c.lnk", 0, Some(s)); let d = add_node("dir", 1258024, Some(s)); { add_node("1000bytes", 1000, Some(d)); @@ -249,7 +255,7 @@ pub fn sample_02_tree() -> Tree { let r = add_node("", root_size, None); { let s = add_node( - format!("{}/{}", FIXTURE_PATH, "sample-02").as_str(), + Path::new(FIXTURE_PATH).join("sample-02").to_str().unwrap(), root_size, Some(r), ); |