Skip to content

Commit 48a86e0

Browse files
author
Thomas Etter
committed
replace some asserts with assert_eq for better error readability
1 parent be993be commit 48a86e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libtest/tests.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn do_not_run_ignored_tests() {
8585
let (tx, rx) = channel();
8686
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
8787
let result = rx.recv().unwrap().result;
88-
assert!(result != TrOk);
88+
assert_ne!(result, TrOk);
8989
}
9090

9191
#[test]
@@ -104,7 +104,7 @@ pub fn ignored_tests_result_in_ignored() {
104104
let (tx, rx) = channel();
105105
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
106106
let result = rx.recv().unwrap().result;
107-
assert!(result == TrIgnored);
107+
assert_eq!(result, TrIgnored);
108108
}
109109

110110
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
@@ -127,7 +127,7 @@ fn test_should_panic() {
127127
let (tx, rx) = channel();
128128
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
129129
let result = rx.recv().unwrap().result;
130-
assert!(result == TrOk);
130+
assert_eq!(result, TrOk);
131131
}
132132

133133
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
@@ -150,7 +150,7 @@ fn test_should_panic_good_message() {
150150
let (tx, rx) = channel();
151151
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
152152
let result = rx.recv().unwrap().result;
153-
assert!(result == TrOk);
153+
assert_eq!(result, TrOk);
154154
}
155155

156156
// FIXME: Re-enable emscripten once it can catch panics again (introduced by #65251)
@@ -227,7 +227,7 @@ fn test_should_panic_but_succeeds() {
227227
let (tx, rx) = channel();
228228
run_test(&TestOpts::new(), false, desc, RunStrategy::InProcess, tx, Concurrent::No);
229229
let result = rx.recv().unwrap().result;
230-
assert!(result == TrFailedMsg("test did not panic as expected".to_string()));
230+
assert_eq!(result, TrFailedMsg("test did not panic as expected".to_string()));
231231
}
232232

233233
fn report_time_test_template(report_time: bool) -> Option<TestExecTime> {
@@ -601,7 +601,7 @@ pub fn sort_tests() {
601601
];
602602

603603
for (a, b) in expected.iter().zip(filtered) {
604-
assert!(*a == b.desc.name.to_string());
604+
assert_eq!(*a, b.desc.name.to_string());
605605
}
606606
}
607607

0 commit comments

Comments
 (0)