Skip to content
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

Consolidate exhaustiveness-related tests #79243

Merged
merged 2 commits into from
Nov 22, 2020

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented Nov 20, 2020

I hunted for tests that only exercised the match exhaustiveness algorithm and regrouped them. I also improved integer-range tests since I had found them lacking while hacking around.
The interest is mainly so that one can pass --test-args patterns and catch most relevant tests.

r? @varkor
@rustbot modify labels: +A-exhaustiveness-checking

@rustbot rustbot added the A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns label Nov 20, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 20, 2020
@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 21, 2020
match 0usize {
0..10 => {},
10..20 => {},
5..15 => {}, // FIXME: should be unreachable
Copy link
Member

Choose a reason for hiding this comment

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

Huh, I'm surprised our tests didn't cover this before. Good catch (and below).

Copy link
Member

Choose a reason for hiding this comment

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

We don't have an issue for this already, do we?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't, but I've got a PR ready to fix it

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how to solve the other FIXME so I guess we could raise an issue. But it's quite tiny, I'm not sure it's worth it

Copy link
Member

Choose a reason for hiding this comment

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

It's worth opening an issue, just so we can keep track of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done #79307

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

It's always good to see more comprehensive tests (especially ones that catch some missing cases)! Thanks!

@varkor
Copy link
Member

varkor commented Nov 22, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 22, 2020

📌 Commit 3213efc has been approved by varkor

@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 Nov 22, 2020
@bors
Copy link
Contributor

bors commented Nov 22, 2020

⌛ Testing commit 3213efc with merge c643dd2...

@bors
Copy link
Contributor

bors commented Nov 22, 2020

☀️ Test successful - checks-actions
Approved by: varkor
Pushing c643dd2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 22, 2020
@bors bors merged commit c643dd2 into rust-lang:master Nov 22, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 22, 2020
@Nadrieril Nadrieril deleted the consolidate-tests branch November 22, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants