Move everything to ignore instead of jwalk

This commit is contained in:
andy.boot
2020-03-22 17:49:43 +00:00
parent f096e82754
commit 1953e107c2
6 changed files with 305 additions and 381 deletions
+39 -38
View File
@@ -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]