Skip to content

Commit f83e238

Browse files
chunqingchenadityapatwardhan
authored andcommitted
add get-help tests for alias (PowerShell#4895)
1 parent ffa0701 commit f83e238

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/powershell/engine/Help/HelpSystem.Tests.ps1

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,29 @@ Describe "Get-Help should find pattern help files" -Tags "CI" {
272272
)
273273
$command.Invoke() | Should Be $result
274274
}
275+
}
276+
277+
Describe "Get-Help should find pattern alias" -Tags "CI" {
278+
# Remove test alias
279+
AfterAll {
280+
Remove-Item alias:\testAlias1
281+
}
282+
283+
It "Get-Help should find alias as command" {
284+
(Get-Help where).Name | Should BeExactly "Where-Object"
285+
}
286+
287+
It "Get-Help should find alias with ? pattern" {
288+
$help = Get-Help wher?
289+
$help.Category | Should BeExactly "Alias"
290+
$help.Synopsis | Should BeExactly "Where-Object"
291+
}
292+
293+
It "Get-Help should find alias with * pattern" {
294+
Set-Alias -Name testAlias1 -Value Where-Object
295+
$help = Get-Help testAlias1*
296+
$help.Category | Should BeExactly "Alias"
297+
$help.Synopsis | Should BeExactly "Where-Object"
298+
}
275299

276300
}

0 commit comments

Comments
 (0)