Auto merge of #54247 - Munksgaard:better-error-message-in-no_lookup_host_duplicates, r=alexcrichton
Improve output if no_lookup_host_duplicates test fails If the test fails, output the offending addresses and a helpful error message. Also slightly improve legibility of the preceding line that puts the addresses into a HashMap.
This commit is contained in:
commit
0c6478998e
1 changed files with 3 additions and 2 deletions
|
|
@ -622,7 +622,8 @@ mod tests {
|
|||
Ok(lh) => lh,
|
||||
Err(e) => panic!("couldn't resolve `localhost': {}", e)
|
||||
};
|
||||
let _na = lh.map(|sa| *addrs.entry(sa).or_insert(0) += 1).count();
|
||||
assert!(addrs.values().filter(|&&v| v > 1).count() == 0);
|
||||
for sa in lh { *addrs.entry(sa).or_insert(0) += 1; };
|
||||
assert_eq!(addrs.iter().filter(|&(_, &v)| v > 1).collect::<Vec<_>>(), vec![],
|
||||
"There should be no duplicate localhost entries");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue