-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add Get-ChildItem
test
#10507
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
,.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.