From ba83e5e901edaa9467ba2b94ce1d7d248bab0737 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 23 Mar 2022 08:51:09 +0100 Subject: [PATCH] use assert_eq instead of x == y. Better output in case of error --- tests/by-util/test_install.rs | 2 +- tests/by-util/test_printenv.rs | 2 +- tests/by-util/test_touch.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs index 3d78331f9..c4ed0d617 100644 --- a/tests/by-util/test_install.rs +++ b/tests/by-util/test_install.rs @@ -483,7 +483,7 @@ fn test_install_copy_then_compare_file() { file2_meta = at.metadata(file2); let after = FileTime::from_last_modification_time(&file2_meta); - assert!(before == after); + assert_eq!(before, after); } #[test] diff --git a/tests/by-util/test_printenv.rs b/tests/by-util/test_printenv.rs index bc0bc0f3c..e02d93254 100644 --- a/tests/by-util/test_printenv.rs +++ b/tests/by-util/test_printenv.rs @@ -26,5 +26,5 @@ fn test_get_var() { .succeeds(); assert!(!result.stdout_str().is_empty()); - assert!(result.stdout_str().trim() == "VALUE"); + assert_eq!(result.stdout_str().trim(), "VALUE"); } diff --git a/tests/by-util/test_touch.rs b/tests/by-util/test_touch.rs index f869d1560..d7a0df129 100644 --- a/tests/by-util/test_touch.rs +++ b/tests/by-util/test_touch.rs @@ -427,7 +427,7 @@ fn test_touch_mtime_dst_succeeds() { let target_time = str_to_filetime("%Y%m%d%H%M", "202103140300"); let (_, mtime) = get_file_times(&at, file); - assert!(target_time == mtime); + assert_eq!(target_time, mtime); } // is_dst_switch_hour returns true if timespec ts is just before the switch