Skip to content

Commit 7510aec

Browse files
committed
Added better error message to the assert!ions in check_unique that show the NodeId and Graphs.
1 parent 0932c74 commit 7510aec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pdg/src/info.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,16 @@ mod test {
224224

225225
fn check_unique(pdg: &Graphs, unique: &[NodeId], non_unique: &[NodeId]) {
226226
for &unique in unique {
227-
assert!(info(pdg, unique).unique);
227+
assert!(
228+
info(pdg, unique).unique,
229+
"expected {unique} to be unique in {pdg}"
230+
);
228231
}
229232
for &non_unique in non_unique {
230-
assert!(!info(pdg, non_unique).unique);
233+
assert!(
234+
!info(pdg, non_unique).unique,
235+
"expected {non_unique} to be non-unique in {pdg}"
236+
);
231237
}
232238
}
233239

0 commit comments

Comments
 (0)