-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add more tests to validate the current command error handling behaviors #15919
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
@iSazonov, I already did my best grouping test cases with |
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
| 1/0 ## throw exception. | ||
| Write-Verbose -Verbose "verbose-message" | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another good one here is parameter binding, where I hit some strangeness in #15833
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you can add tests here (or to another file as you see fit) to cover the scenario after you get it fixed in #15833.
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Language/Scripting/CommandErrorHandling.Tests.ps1
Outdated
Show resolved
Hide resolved
|
🎉 Handy links: |
|
🎉 Handy links: |
PR Summary
This PR adds 39 tests to validate and track the existing command error handling behaviors.
This PR is a preparation for #15177. The new tests added here will protect regressions that could be introduced to the command error handling by #15177.
Please be noted that those tests are by no means covering every aspect of the error handling behaviors.
I tried to cover most of the subtle behaviors -- some are not well known and may even be a little confusing to some extent. This is because these subtle behaviors may not be well tested, and adding those new tests will help guard me from introducing regression without knowing when working on #15177.
For the more obvious/common behaviors, I hope they are already covered by existing tests.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.