Skip to content

Improve output if no_lookup_host_duplicates test fails #54247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Munksgaard
Copy link
Contributor

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.

@rust-highfive
Copy link
Contributor

r? @aidanhs

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2018
@Munksgaard
Copy link
Contributor Author

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned aidanhs Sep 15, 2018
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 now duplicate localhost entries");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/now/no

@eddyb
Copy link
Member

eddyb commented Sep 15, 2018

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned eddyb Sep 15, 2018
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.
@Munksgaard Munksgaard force-pushed the better-error-message-in-no_lookup_host_duplicates branch from 2828396 to 0e9d260 Compare September 15, 2018 15:17
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Sep 15, 2018

📌 Commit 0e9d260 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2018
@bors
Copy link
Collaborator

bors commented Sep 17, 2018

⌛ Testing commit 0e9d260 with merge 0c64789...

bors added a commit that referenced this pull request Sep 17, 2018
…ost_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.
@bors
Copy link
Collaborator

bors commented Sep 17, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 0c64789 to master...

@bors bors merged commit 0e9d260 into rust-lang:master Sep 17, 2018
@Munksgaard Munksgaard deleted the better-error-message-in-no_lookup_host_duplicates branch September 17, 2018 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants