-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Test fixes and code coverage automation fixes. #5046
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
Changes from all commits
ed31099
3bb19bf
8bd98e6
4f26945
f0a6693
bc068e8
b5f23d9
080089f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -433,7 +433,8 @@ Describe "TabCompletion" -Tags CI { | |
| @{ inputStr = '$global:max'; expected = '$global:MaximumHistoryCount'; setup = $null } | ||
| @{ inputStr = '$PSMod'; expected = '$PSModuleAutoLoadingPreference'; setup = $null } | ||
| ## tab completion for variable in path | ||
| @{ inputStr = 'cd $pshome\Modu'; expected = Join-Path $PSHOME 'Modules'; setup = $null } | ||
| ## if $PSHOME contains a space tabcompletion adds ' around the path | ||
| @{ inputStr = 'cd $pshome\Modu'; expected = if($PSHOME.Contains(' ')) { "'$(Join-Path $PSHOME 'Modules')'" } else { Join-Path $PSHOME 'Modules' }; setup = $null } | ||
| @{ inputStr = 'cd "$pshome\Modu"'; expected = "`"$(Join-Path $PSHOME 'Modules')`""; setup = $null } | ||
| @{ inputStr = '$PSHOME\System.Management.Au'; expected = Join-Path $PSHOME 'System.Management.Automation.dll'; setup = $null } | ||
| @{ inputStr = '"$PSHOME\System.Management.Au"'; expected = "`"$(Join-Path $PSHOME 'System.Management.Automation.dll')`""; setup = $null } | ||
|
|
@@ -467,7 +468,7 @@ Describe "TabCompletion" -Tags CI { | |
| $beforeTab = "\\localhost\$homeDrive\wind" | ||
| $afterTab = "& '\\localhost\$homeDrive\Windows'" | ||
| $res = TabExpansion2 -inputScript $beforeTab -cursorColumn $beforeTab.Length | ||
| $res.CompletionMatches.Count | Should BeExactly 1 | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should Be $afterTab | ||
| } | ||
|
|
||
|
|
@@ -496,7 +497,7 @@ Describe "TabCompletion" -Tags CI { | |
| $afterTab = 'filesystem::/usr' -f $env:SystemDrive | ||
| } | ||
| $res = TabExpansion2 -inputScript $beforeTab -cursorColumn $beforeTab.Length | ||
| $res.CompletionMatches.Count | Should BeExactly 1 | ||
|
||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should Be $afterTab | ||
| } | ||
|
|
||
|
|
@@ -914,13 +915,13 @@ dir -Recurse ` | |
| @{ inputStr = 'Get-CimInstance Win32_Process | ?{ $_.ProcessId -eq $Pid } | Get-CimAssociatedInstance -ResultClassName Win32_ComputerS'; expected = 'Win32_ComputerSystem' } | ||
| @{ inputStr = 'Get-CimInstance -Namespace root/Interop -ClassName Win32_PowerSupplyP'; expected = 'Win32_PowerSupplyProfile' } | ||
| @{ inputStr = 'Get-CimInstance __NAMESP'; expected = '__NAMESPACE' } | ||
| @{ inputStr = 'Get-CimInstance -Namespace root/Int'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Get-CimInstance -Namespace root/Inter'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Get-CimInstance -Namespace root/Int*ro'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Get-CimInstance -Namespace root/Interop/'; expected = 'root/Interop/ms_409' } | ||
| @{ inputStr = 'New-CimInstance -Namespace root/Int'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Invoke-CimMethod -Namespace root/Int'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Get-CimClass -Namespace root/Int'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Register-CimIndicationEvent -Namespace root/Int'; expected = 'root/Interop' } | ||
| @{ inputStr = 'New-CimInstance -Namespace root/Inter'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Invoke-CimMethod -Namespace root/Inter'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Get-CimClass -Namespace root/Inter'; expected = 'root/Interop' } | ||
| @{ inputStr = 'Register-CimIndicationEvent -Namespace root/Inter'; expected = 'root/Interop' } | ||
| @{ inputStr = '[Microsoft.Management.Infrastructure.CimClass]$c = $null; $c.CimClassNam'; expected = 'CimClassName' } | ||
| @{ inputStr = '[Microsoft.Management.Infrastructure.CimClass]$c = $null; $c.CimClassName.Substrin'; expected = 'Substring(' } | ||
| @{ inputStr = 'Get-CimInstance -ClassName Win32_Process | %{ $_.ExecutableP'; expected = 'ExecutablePath' } | ||
|
|
||
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.
Maybe
Should BeGreaterThan 0- else next line can throw with useless message.Uh oh!
There was an error while loading. Please reload this page.
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 Can you elaborate. I want to check it for being exactly 1. If the check fails, the next line will not be executed and the It will be marked as 'Failed'.
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.
If $res.CompletionMatches.Count = 0 then $res.CompletionMatches[0] will throw with generic message.
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.
But if $res.CompletionMatches.Count = 2 and we are using
Should BeGreaterThan 0then the test might pass but we are getting more matches than expected.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 wonder now - why are we removing this line with
Should BeExactly 1if we want just 1 ?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.
Correct, I confused this with the about_help test. This can be BeGreaterThan 0.
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.
Fixed.