-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Added more tests for import-alias by file, regarding parsing 'difficult' aliases strings #9247
Added more tests for import-alias by file, regarding parsing 'difficult' aliases strings #9247
Conversation
…st for including a quote character fails, as illegal characters are in the path
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
…ked by get-alias instead of executing the alias, which is a cleaner method to check whether the alias is imported correctly
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
…e is present. The tests should now pass
We should now be able to safely delete |
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
I accidently commited the content of #9091 branch into this branch. I'll try to undo it
apparently this happened during the accidental merge due to code ownership. Although I fixed that the commits were reverted, I don't know if this request for review is a problem of any kind. |
0e7b95f
to
d2f1311
Compare
…alid file, it now creates a new file only containing the invalid alias
All suggestions are implemented,thanks @iSazonov. |
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
@SteveL-MSFT I implemented all your suggestions |
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.
LGTM
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.
@SytzeAndr Thanks for fixing all style issues in the old file!
test/powershell/Modules/Microsoft.PowerShell.Utility/Import-Alias.Tests.ps1
Outdated
Show resolved
Hide resolved
…ias.Tests.ps1 Co-Authored-By: SytzeAndr <s.p.e.andringa@student.tudelft.nl>
@adityapatwardhan Could you please update your review? |
@SytzeAndr Thank you for your contribution |
PR Summary
According to this comment by daxian-dbw,
"abc""def"
should be parsed toabc"def
. This was not covered in the old test cases, but should be now with this PR.This PR adds tests for the
import-alias
by file, in a seperate PR as discussed in #9091. After this gets accepted, it should be possible to start refactoringimport-alias
. Details about this refactorization can be found in #9091 .This pr adds the following test cases for import alias by file:
"abc""def"
should parse toabc"def
"aaa"
should parse toaaa
"a,b"
should parse toa,b
If more exhaustive testing is required, please let me know.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.