Skip to content
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

Updated csproj to use the latest help package #5454

Merged
merged 3 commits into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/powershell-unix/powershell-unix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="libpsl" Version="6.0.0-*" />
<PackageReference Include="psrp" Version="1.1.0-*" />
<PackageReference Include="PSDesiredStateConfiguration" Version="6.0.0-beta.8" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-alpha01" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/powershell-win-core/powershell-win-core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<ItemGroup>
<PackageReference Include="PSDesiredStateConfiguration" Version="6.0.0-beta.8" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-alpha01" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
<PackageReference Include="psrp.windows" Version="6.0.0-*" />
</ItemGroup>

Expand Down
32 changes: 17 additions & 15 deletions test/powershell/Host/TabCompletion/TabCompletion.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,6 @@ Describe "TabCompletion" -Tags CI {
$res.CompletionMatches[0].CompletionText | Should Be 'namespace'
}

It 'Should complete about help topic' {

$aboutHelpPath = Join-Path $PSHOME (Get-Culture).Name

## If help content does not exist, tab completion will not work. So update it first.
if(-not (Test-Path (Join-Path $aboutHelpPath "about_Splatting.help.txt")))
{
Update-Help -Force -ErrorAction SilentlyContinue
}

$res = TabExpansion2 -inputScript 'get-help about_spla' -cursorColumn 'get-help about_spla'.Length
$res.CompletionMatches.Count | Should Be 1
$res.CompletionMatches[0].CompletionText | Should BeExactly 'about_Splatting'
}

Context NativeCommand {
BeforeAll {
$nativeCommand = (Get-Command -CommandType Application -TotalCount 1).Name
Expand Down Expand Up @@ -953,6 +938,23 @@ dir -Recurse `
}
}

Describe "Tab completion help test" -Tags @('RequireAdminOnWindows', 'CI') {
It 'Should complete about help topic' {

$aboutHelpPath = Join-Path $PSHOME (Get-Culture).Name

## If help content does not exist, tab completion will not work. So update it first.
if (-not (Test-Path (Join-Path $aboutHelpPath "about_Splatting.help.txt")))
{
Update-Help -Force -ErrorAction SilentlyContinue
}

$res = TabExpansion2 -inputScript 'get-help about_spla' -cursorColumn 'get-help about_spla'.Length
$res.CompletionMatches.Count | Should Be 1
$res.CompletionMatches[0].CompletionText | Should BeExactly 'about_Splatting'
}
}

Describe "Tab completion tests with remote Runspace" -Tags Feature {
BeforeAll {
if ($IsWindows) {
Expand Down
13 changes: 9 additions & 4 deletions test/powershell/engine/Help/HelpSystem.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,21 @@ Describe "Validate that Get-Help returns provider-specific help" -Tags @('CI', '
}
}

Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI') {
Describe "Validate about_help.txt under culture specific folder works" -Tags @('CI', 'RequireAdminOnWindows') {
BeforeAll {
$modulePath = "$pshome\Modules\Test"
$null = New-Item -Path $modulePath\en-US -ItemType Directory -Force
New-ModuleManifest -Path $modulePath\test.psd1 -RootModule test.psm1
Set-Content -Path $modulePath\test.psm1 -Value "function foo{}"
Set-Content -Path $modulePath\en-US\about_testhelp.help.txt -Value "Hello" -NoNewline
## This is needed for getting about topics. We use -Force, so we always update.
Update-Help -Force

$aboutHelpPath = Join-Path $PSHOME (Get-Culture).Name

## If help content does not exist, update it first.
if (-not (Test-Path (Join-Path $aboutHelpPath "about_Variables.help.txt")))
{
Update-Help -Force -ErrorAction SilentlyContinue
}
}

AfterAll {
Expand All @@ -206,7 +212,6 @@ Describe "Validate about_help.txt under culture specific folder works" -Tags @('
}

It "Get-Help for about_Variable should return only one help object" {

$help = Get-Help about_Variables
$help.count | Should Be 1
}
Expand Down