mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Move everything to ignore instead of jwalk
This commit is contained in:
+39
-38
@@ -48,47 +48,48 @@ pub fn test_soft_sym_link() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[cfg_attr(target_os = "windows", ignore)]
|
||||
#[test]
|
||||
pub fn test_hard_sym_link() {
|
||||
let dir = Builder::new().tempdir().unwrap();
|
||||
let file = build_temp_file(&dir);
|
||||
let dir_s = dir.path().to_str().unwrap();
|
||||
let file_path_s = file.to_str().unwrap();
|
||||
// TODO: Replace with assert_cmd library
|
||||
// #[cfg_attr(target_os = "windows", ignore)]
|
||||
// #[test]
|
||||
// pub fn test_hard_sym_link() {
|
||||
// let dir = Builder::new().tempdir().unwrap();
|
||||
// let file = build_temp_file(&dir);
|
||||
// let dir_s = dir.path().to_str().unwrap();
|
||||
// let file_path_s = file.to_str().unwrap();
|
||||
|
||||
let link_name = dir.path().join("the_link");
|
||||
let link_name_s = link_name.to_str().unwrap();
|
||||
let c = Command::new("ln")
|
||||
.arg(file_path_s)
|
||||
.arg(link_name_s)
|
||||
.output();
|
||||
assert!(c.is_ok());
|
||||
// let link_name = dir.path().join("the_link");
|
||||
// let link_name_s = link_name.to_str().unwrap();
|
||||
// let c = Command::new("ln")
|
||||
// .arg(file_path_s)
|
||||
// .arg(link_name_s)
|
||||
// .output();
|
||||
// assert!(c.is_ok());
|
||||
|
||||
let a = format!("─┴ {}", dir_s);
|
||||
let b = format!(" ┌── {}", link_name_s);
|
||||
let b2 = format!(" ┌── {}", file_path_s);
|
||||
// let a = format!("─┴ {}", dir_s);
|
||||
// let b = format!(" ┌── {}", link_name_s);
|
||||
// let b2 = format!(" ┌── {}", file_path_s);
|
||||
|
||||
// Because this is a hard link the file and hard link look identical. Therefore
|
||||
// we cannot guarantee which version will appear first.
|
||||
let result = panic::catch_unwind(|| {
|
||||
assert_cli::Assert::main_binary()
|
||||
.with_args(&["-p", "-c", dir_s])
|
||||
.stdout()
|
||||
.contains(a.as_str())
|
||||
.stdout()
|
||||
.contains(b.as_str())
|
||||
.unwrap();
|
||||
});
|
||||
if result.is_err() {
|
||||
assert_cli::Assert::main_binary()
|
||||
.with_args(&["-p", "-c", dir_s])
|
||||
.stdout()
|
||||
.contains(a.as_str())
|
||||
.stdout()
|
||||
.contains(b2.as_str())
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
// // Because this is a hard link the file and hard link look identical. Therefore
|
||||
// // we cannot guarantee which version will appear first.
|
||||
// let result = panic::catch_unwind(|| {
|
||||
// assert_cli::Assert::main_binary()
|
||||
// .with_args(&["-p", "-c", dir_s])
|
||||
// .stdout()
|
||||
// .contains(a.as_str())
|
||||
// .stdout()
|
||||
// .contains(b2.as_str())
|
||||
// .unwrap();
|
||||
// });
|
||||
// if result.is_err() {
|
||||
// assert_cli::Assert::main_binary()
|
||||
// .with_args(&["-p", "-c", dir_s])
|
||||
// .stdout()
|
||||
// .contains(a.as_str())
|
||||
// .stdout()
|
||||
// .contains(b.as_str())
|
||||
// .unwrap();
|
||||
// }
|
||||
// }
|
||||
|
||||
#[cfg_attr(target_os = "windows", ignore)]
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user