Skip to content

Test for exhaustiveness cut-off. #16395

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

Merged
merged 2 commits into from
May 5, 2018

Conversation

davidungar
Copy link
Contributor

Adds a test for the recently-added -switch-checking-invocation-threshold= frontend option.

@davidungar davidungar force-pushed the adding-switch-cutoff-test branch from ae09ac2 to 757dcf0 Compare May 4, 2018 20:44
@davidungar
Copy link
Contributor Author

@swift-ci please smoke test

@davidungar davidungar requested a review from jrose-apple May 4, 2018 20:45
// LIMIT: error: the compiler is unable to check that this switch is exhaustive in reasonable time
// LIMIT-NOT: error: switch must be exhaustive
// NO_LIMIT: error: switch must be exhaustive
// NO_LIMIT-NOT: error: the compiler is unable to check that this switch is exhaustive in reasonable time
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks fine, but it's worth pointing out that -NOT lines only check that certain text does not appear after the previous positive check and before the next positive check. You could either bracket your LIMIT/NO_LIMIT lines with the -NOT checks, or save the error output to a file and check it twice (a common enough idiom in our test suite, look for -check-prefix NEGATIVE), or just not worry too much about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you want to review the revised test?

@davidungar
Copy link
Contributor Author

@swift-ci please smoke test

@davidungar davidungar force-pushed the adding-switch-cutoff-test branch from 73028cf to ea749c2 Compare May 5, 2018 02:03
@davidungar
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

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

This works too. It's not the way we'd usually do negative tests, but I like that it's symmetrical.

@davidungar
Copy link
Contributor Author

Thanks, Jordan.

@davidungar davidungar merged commit 1502e9d into swiftlang:master May 5, 2018
@davidungar davidungar changed the title Provisional test for exhaustiveness cut-off. Test for exhaustiveness cut-off. May 5, 2018
@davidungar davidungar deleted the adding-switch-cutoff-test branch June 14, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants