track caller to give better line numbers on test errors

This commit is contained in:
Niko Matsakis 2021-10-30 05:19:54 -04:00
parent dc5ea932ef
commit 0630fb1139

View file

@ -24,6 +24,7 @@ pub(crate) struct TestContextImpl {
}
impl TestContextImpl {
#[track_caller]
pub(crate) fn assert_log(&self, expected_log: &[&str]) {
let expected_text = &format!("{:#?}", expected_log);
let actual_text = &format!("{:#?}", self.log().take());