From f83e238082a0b9866ae0a8e2cb0b62e5c690c195 Mon Sep 17 00:00:00 2001 From: Chunqing Chen Date: Thu, 28 Sep 2017 08:47:42 -0700 Subject: [PATCH] add get-help tests for alias (#4895) --- .../engine/Help/HelpSystem.Tests.ps1 | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/powershell/engine/Help/HelpSystem.Tests.ps1 b/test/powershell/engine/Help/HelpSystem.Tests.ps1 index e229b68dc..ee3082a74 100644 --- a/test/powershell/engine/Help/HelpSystem.Tests.ps1 +++ b/test/powershell/engine/Help/HelpSystem.Tests.ps1 @@ -272,5 +272,29 @@ Describe "Get-Help should find pattern help files" -Tags "CI" { ) $command.Invoke() | Should Be $result } +} + + Describe "Get-Help should find pattern alias" -Tags "CI" { + # Remove test alias + AfterAll { + Remove-Item alias:\testAlias1 + } + + It "Get-Help should find alias as command" { + (Get-Help where).Name | Should BeExactly "Where-Object" + } + + It "Get-Help should find alias with ? pattern" { + $help = Get-Help wher? + $help.Category | Should BeExactly "Alias" + $help.Synopsis | Should BeExactly "Where-Object" + } + + It "Get-Help should find alias with * pattern" { + Set-Alias -Name testAlias1 -Value Where-Object + $help = Get-Help testAlias1* + $help.Category | Should BeExactly "Alias" + $help.Synopsis | Should BeExactly "Where-Object" + } }