Skip to content

Commit

Permalink
Fix platform size difference of 'sample_01_tree' for test
Browse files Browse the repository at this point in the history
- symbolic links are '0' size on windows vs '1' on *nix-type platforms
  • Loading branch information
rivy authored and Byron committed Jul 22, 2020
1 parent 48cbe09 commit 62c5833
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/interactive/app_test/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"])?;
Expand Down
6 changes: 6 additions & 0 deletions src/interactive/app_test/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,21 @@ 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));
{
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));
Expand Down

0 comments on commit 62c5833

Please sign in to comment.