diff options
author | andy.boot <bootandy@gmail.com> | 2022-08-18 12:24:46 +0100 |
---|---|---|
committer | andy.boot <bootandy@gmail.com> | 2022-08-18 13:39:01 +0100 |
commit | 4eb3f295657d056106de0c3e280a178c8c7657e5 (patch) | |
tree | ea5c2a34f7f8574261680b9c3158bf75bd03f9c8 | |
parent | d64092d8a1679b7d4f59d248189646d8072ac6d5 (diff) |
Tests: Predictable iteration order allows stricter
Now files are iterated thru in a preditermined order we can tighten the
boundaries of the test_hard_sym_link test.
Link will not be displayed, only the file name
-rw-r--r-- | tests/tests_symlinks.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/tests_symlinks.rs b/tests/tests_symlinks.rs index 0ade925..4a26d66 100644 --- a/tests/tests_symlinks.rs +++ b/tests/tests_symlinks.rs @@ -90,18 +90,17 @@ pub fn test_hard_sym_link() { .output(); assert!(c.is_ok()); - let link_output = format!(" ┌── {}", get_file_name(link_name_s.into())); let file_output = format!(" ┌── {}", get_file_name(file_path_s.into())); let dirs_output = format!("─┴ {}", dir_s); let mut cmd = Command::cargo_bin("dust").unwrap(); let output = cmd.arg("-p").arg("-c").arg(dir_s).unwrap().stdout; - // Because this is a hard link the file and hard link look identical. Therefore - // we cannot guarantee which version will appear first. + // The link should not appear in the output because multiple inodes are now ordered + // then filtered. let output = str::from_utf8(&output).unwrap(); assert!(output.contains(dirs_output.as_str())); - assert!(output.contains(link_output.as_str()) || output.contains(file_output.as_str())); + assert!(output.contains(file_output.as_str())); } #[cfg_attr(target_os = "windows", ignore)] |