Add Get-ChildItem test#10507
Conversation
|
/cc @mklement0 for information. |
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Outdated
Show resolved
Hide resolved
| try { | ||
| New-Item -Type File 'a`[b]' -ErrorAction SilentlyContinue > $null | ||
| $WithInclude = Get-ChildItem * -Include 'a```[b`]' | ||
| $WithPath = Get-ChildItem -Path 'a```[b`]' |
There was a problem hiding this comment.
I suggest adding another test where escaped and [ and ] are combined with * or ? - because a bug currently lurks there (you inexplicably need an extra round of escaping then); e.g., Get-Item -Path 'a```[b*' breaks at the moment.
There was a problem hiding this comment.
There was a problem hiding this comment.
I removed the test because it seems it looks like a bug. I hope we will discuss this in new issue.
There was a problem hiding this comment.
@iSazonov: We have a catch-all issue at #7999 and one regarding invalid patterns getting ignored #6733. Perhaps put the tests in commented out for now, with a link to the issues?
Also note that ] doesn't need escaping, as long as the [ is escaped; so, given that Get-ChildItem -Path 'a```[b`]' works, but Get-ChildItem -Path 'a```[b]' (no escaping of ]) doesn't, that should be considered another bug.
There was a problem hiding this comment.
Perhaps put the tests in commented out for now, with a link to the issues?
We could add tests in pending state but I think it will be more useful if it is in related discussions than hidden in tests.
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1
Show resolved
Hide resolved
|
🎉 Handy links: |
PR Summary
Add new test for #3724 to exclude a regression.
PR Context
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.