summaryrefslogtreecommitdiff
path: root/test/test_unistd.rs
diff options
context:
space:
mode:
authorXavier L'Heureux <xavier.lheureux@icloud.com>2019-09-14 11:29:44 -0400
committerXavier L'Heureux <xavier.lheureux@icloud.com>2019-09-19 22:20:25 -0400
commitbbc42e7845d73362ce94662882e8c20289337612 (patch)
tree1a9b19c6f6b49ef4bd6c5002accedd11662ac9cc /test/test_unistd.rs
parente201dfdccac5f862ea1ef5a5e264115cd473a9bc (diff)
downloadnix-bbc42e7845d73362ce94662882e8c20289337612.zip
Where relevant, replace equality checks in assert! with assert_eq!
`assert_eq!` gives more debug info when the test fails by default than `assert!`. This should help make debugging easier.
Diffstat (limited to 'test/test_unistd.rs')
-rw-r--r--test/test_unistd.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_unistd.rs b/test/test_unistd.rs
index 21aaa0fc..544c2b13 100644
--- a/test/test_unistd.rs
+++ b/test/test_unistd.rs
@@ -29,7 +29,7 @@ fn test_fork_and_waitpid() {
let wait_status = waitpid(child, None);
match wait_status {
// assert that waitpid returned correct status and the pid is the one of the child
- Ok(WaitStatus::Exited(pid_t, _)) => assert!(pid_t == child),
+ Ok(WaitStatus::Exited(pid_t, _)) => assert_eq!(pid_t, child),
// panic, must never happen
s @ Ok(_) => panic!("Child exited {:?}, should never happen", s),
@@ -111,7 +111,7 @@ fn test_getsid() {
let none_sid: ::libc::pid_t = getsid(None).unwrap().into();
let pid_sid: ::libc::pid_t = getsid(Some(getpid())).unwrap().into();
assert!(none_sid > 0);
- assert!(none_sid == pid_sid);
+ assert_eq!(none_sid, pid_sid);
}
#[cfg(any(target_os = "linux", target_os = "android"))]