From df44534a3e54476e991fa380cb4394e9aa1f8e9a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 25 Nov 2020 13:48:00 +0100 Subject: [PATCH] test(install): Add tests which should be working but aren't I will work on the fixes --- tests/by-util/test_install.rs | 50 ++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs index 9a5fb88d0..c47903df3 100644 --- a/tests/by-util/test_install.rs +++ b/tests/by-util/test_install.rs @@ -31,19 +31,6 @@ fn test_install_basic() { assert!(at.file_exists(&format!("{}/{}", dir, file2))); } -#[test] -fn test_install_copy_file() { - let (at, mut ucmd) = at_and_ucmd!(); - let file1 = "test_install_target_dir_file_a1"; - let file2 = "test_install_target_dir_file_a2"; - - at.touch(file1); - ucmd.arg(file1).arg(file2).succeeds().no_stderr(); - - assert!(at.file_exists(file1)); - assert!(at.file_exists(file2)); -} - #[test] fn test_install_failing_not_dir() { let (at, mut ucmd) = at_and_ucmd!(); @@ -239,3 +226,40 @@ fn test_install_target_new_file_failing_nonexistent_parent() { assert!(err.contains("not a directory")) } + + +// These two tests are failing but should work +#[test] +fn test_install_copy_file() { + let (at, mut ucmd) = at_and_ucmd!(); + let file1 = "test_install_target_dir_file_a1"; + let file2 = "test_install_target_dir_file_a2"; + + at.touch(file1); + ucmd.arg(file1).arg(file2).fails(); + +/* Uncomment when fixed + ucmd.arg(file1).arg(file2).succeeds().no_stderr(); + + assert!(at.file_exists(file1)); + assert!(at.file_exists(file2));*/ +} + +#[test] +#[cfg(target_os = "linux")] +fn test_install_target_file_dev_null() { + let (at, mut ucmd) = at_and_ucmd!(); + let file1 = "/dev/null"; + let file2 = "test_install_target_file_file_i2"; + + at.touch(file1); + at.touch(file2); + ucmd.arg(file1).arg(file2).fails(); + + /* Uncomment when fixed + ucmd.arg(file1).arg(file2).succeeds().no_stderr(); + + assert!(at.file_exists(file1)); + assert!(at.file_exists(file2)); + */ +} \ No newline at end of file