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.
@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-aliasby 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,bIf more exhaustive testing is required, please let me know.
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.