Fix for #4520 '-ArgumentList should accept @() or $null'#6597
Fix for #4520 '-ArgumentList should accept @() or $null'#6597adityapatwardhan merged 7 commits intoPowerShell:masterfrom
Conversation
There was a problem hiding this comment.
Should it be -ArgumentList "" ?
And should we tests -ArgumentList @() too?
|
@BrucePay can you please push an empty commit with |
|
@BrucePay I believe GitHub won't auto-close issues in the title, so I put For @markekraus' request, you can just do |
There was a problem hiding this comment.
We could use -TestCases and replace last three tests with one.
There was a problem hiding this comment.
I'd rather do this in a separate check-in. This whole file needs serious clean up e.g. there are tests that depend on notepad.
|
@BrucePay looks like you accidentally pulled in other commits into this PR. Find me tomorrow in the office to get this cleaned up. |
|
@SteveL-MSFT Not sure how it happened bu oh my yes :-( I will definitely find you. |
d2da162 to
761748a
Compare
Removed the [ValidateIsNotNulOrEmpty] attribute from the parameter.
…playing new windows on Windows.
761748a to
22e1d11
Compare
22e1d11 to
01603a5
Compare
| It 'Should run without errors when -ArgumentList is $null' { | ||
| $process = Start-Process $pingCommand -ArgumentList $null -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
Is this check required?
There was a problem hiding this comment.
These are basic sanity tests to make sure the process was created and is running (has an ID).
There was a problem hiding this comment.
If the process is not started the $process is $null.
| It "Should run without errors when -ArgumentList is @()" { | ||
| $process = Start-Process $pingCommand -ArgumentList @() -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
These are basic sanity tests to make sure the process was created and is running (has an ID).
| It "Should run without errors when -ArgumentList is ''" { | ||
| $process = Start-Process $pingCommand -ArgumentList '' -PassThru @extraArgs | ||
| $process.Length | Should -Be 1 | ||
| $process.Id | Should -BeGreaterThan 1 |
There was a problem hiding this comment.
These are basic sanity tests to make sure the process was created and is running (has an ID).
|
pushed a commit with |
|
@adityapatwardhan Please make sure you check the PR title before merging. The |
|
@TravisEz13 Yes agreed, missed it. |
… affect current functionality PowerShell/PowerShell#6597
Fix #4520
Just removed the [ValidateIsNotNulOrEmpty] attribute from the ArgumentList parameter. (Also removed some obsolete comments).
PR Summary
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests