Skip to content

Commit

Permalink
Update call_spy_map.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-claudia authored Jun 29, 2024
1 parent df04fa3 commit 0daa72b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/test_utils/spy/call_spy_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {

let guard = self.states.lock().unwrap_or_else(|e| e.into_inner());

for (key, state) in guard.iter() {
for state in guard.iter() {
if !state.results.is_empty() {
write!(&mut fail_pairs, "{}{:?} => {:?}", prefix, key, &state.results)
write!(&mut fail_pairs, "{}{:?} => {:?}", prefix, &state.key, &state.results)
.unwrap();
prefix = ", ";
}
}

drop(guard); // don't poison

if !result.is_empty() {
if !fail_pairs.is_empty() {
panic!(
"Unexpected calls remaining for `{}`: {{{}}}",
self.name, fail_pairs
Expand All @@ -101,7 +101,7 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {

'outer: for (key, value) in expected.iter() {
for (k, v) in expected_map.iter_mut() {
if k == key {
if *k == key {
v.push(value);
continue 'outer;
}
Expand Down Expand Up @@ -136,8 +136,8 @@ impl<K: PartialEq, I, O> CallSpyMap<K, I, O> {

'outer: for state in states {
for (key, expected) in expected_map {
if key == states.key {
if !state.args.iter().eq(expected) {
if key == state.key {
if !state.args.iter().eq(&expected) {
return false;
}

Expand Down

0 comments on commit 0daa72b

Please sign in to comment.