Skip to content

Commit

Permalink
Added better error message to the assert!ions in check_unique tha…
Browse files Browse the repository at this point in the history
…t show the `NodeId` and `Graphs`.
  • Loading branch information
kkysen committed Sep 16, 2022
1 parent 0932c74 commit 7510aec
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pdg/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,16 @@ mod test {

fn check_unique(pdg: &Graphs, unique: &[NodeId], non_unique: &[NodeId]) {
for &unique in unique {
assert!(info(pdg, unique).unique);
assert!(
info(pdg, unique).unique,
"expected {unique} to be unique in {pdg}"
);
}
for &non_unique in non_unique {
assert!(!info(pdg, non_unique).unique);
assert!(
!info(pdg, non_unique).unique,
"expected {non_unique} to be non-unique in {pdg}"
);
}
}

Expand Down

0 comments on commit 7510aec

Please sign in to comment.