Skip to content

Commit 4b0c1a7

Browse files
committed
Use track_caller attribute on the util functions to get a correct line number when test fail
1 parent b4f7a38 commit 4b0c1a7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/serde-migrated.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ struct Simple {
1414
d: Option<String>,
1515
}
1616

17+
#[track_caller]
1718
fn test_parse_ok<'a, T: std::fmt::Debug>(errors: &[(&'a str, T)])
1819
where
1920
T: PartialEq + Debug + ser::Serialize + for<'de> de::Deserialize<'de>,
@@ -37,6 +38,7 @@ where
3738
}
3839
}
3940

41+
#[track_caller]
4042
fn test_parse_err<'a, T>(errors: &[&'a str])
4143
where
4244
T: PartialEq + Debug + ser::Serialize + for<'de> de::Deserialize<'de>,

0 commit comments

Comments
 (0)