From cd97adb39d8085f4fca406c9cba6c54641b838e2 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 13 Dec 2020 11:30:49 +0100 Subject: [PATCH] Minor fixes in the tests --- tests/by-util/test_chown.rs | 1 + tests/by-util/test_cp.rs | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tests/by-util/test_chown.rs b/tests/by-util/test_chown.rs index afd6f567f..7b663e9c9 100644 --- a/tests/by-util/test_chown.rs +++ b/tests/by-util/test_chown.rs @@ -384,6 +384,7 @@ fn test_root_preserve() { } #[cfg(target_os = "linux")] +#[test] fn test_big_p() { if get_effective_uid() != 0 { new_ucmd!() diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index a18386b97..47d28f63a 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -42,8 +42,7 @@ fn test_cp_cp() { .run(); // Check that the exit code represents a successful copy. - let exit_success = result.success; - assert!(exit_success); + assert!(result.success); // Check the content of the destination file that was copied. assert_eq!(at.read(TEST_HELLO_WORLD_DEST), "Hello, World!\n"); @@ -386,8 +385,7 @@ fn test_cp_deref() { .run(); // Check that the exit code represents a successful copy. - let exit_success = result.success; - assert!(exit_success); + assert!(result.success); let path_to_new_symlink = at .subdir .join(TEST_COPY_TO_FOLDER) @@ -430,8 +428,7 @@ fn test_cp_no_deref() { .run(); // Check that the exit code represents a successful copy. - let exit_success = result.success; - assert!(exit_success); + assert!(result.success); let path_to_new_symlink = at .subdir .join(TEST_COPY_TO_FOLDER) @@ -484,8 +481,7 @@ fn test_cp_deref_folder_to_folder() { println!("cp output {}", result.stdout); // Check that the exit code represents a successful copy. - let exit_success = result.success; - assert!(exit_success); + assert!(result.success); #[cfg(not(windows))] { @@ -589,8 +585,7 @@ fn test_cp_no_deref_folder_to_folder() { println!("cp output {}", result.stdout); // Check that the exit code represents a successful copy. - let exit_success = result.success; - assert!(exit_success); + assert!(result.success); #[cfg(not(windows))] {