Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

HelpSystem.Tests.ps1 cannot handle culture not being defined

未关闭 适合新手
#27,532 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
powershell
领域
testing-qa

调研方向

先查看 test/powershell/engine/Help/HelpSystem.Tests.ps1 中第 425 行和第 434 行附近的内容,然后比较 test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 中第 438-441 行附近的 culture 处理。将当前 culture 设置为 Invariant Language (LCID 127) 后,运行受影响的 Help 测试。如果两个 full-help 测试都在该环境中无错误通过,则表示完成。

由索引模型根据 Issue 内容生成。

描述

Needs-Triage WG-Interactive-Console WG-NeedsReview
Prerequisites
Steps to reproduce

Reproducible on 7.6.2.

The test "help should return full view without -Full switch" and "help should return full view even with -Full switch" have the problem, that they'll break if the current culture is Invariant Language (Invariant Country) (LCID 127). This can happen on Linux systems if the LANG etc. environment variables are left to C.UTF-8. In this situation, there's no Get-Help pages available in the current language - and thus no PARAMETERS section either on a "Full" help page, breaking the test.

In the past, UpdatableHelpSystem.Tests.ps1 has been fixed by 16558c94146e44422f9e5b4f0f917775def51087 and now sets a culture if LCID is 127. This test would need a similar fix.

Expected behavior
No error.
Actual behavior
[-] help should return full view without -Full switch 6ms
      Expected a value, but got $null or empty.
      425:         $gpsHelp | Where-Object {$_ -cmatch '^PARAMETERS'} | Should -Not -BeNullOrEmpty
      at <ScriptBlock>, /build/powershell/src/PowerShell/test/powershell/engine/Help/HelpSystem.Tests.ps1: line 425
    [-] help should return full view even with -Full switch 6ms
      Expected a value, but got $null or empty.
      434:         $gpsHelp | Where-Object {$_ -cmatch '^PARAMETERS'} | Should -Not -BeNullOrEmpty
      at <ScriptBlock>, /build/powershell/src/PowerShell/test/powershell/engine/Help/HelpSystem.Tests.ps1: line 434
Error details

Environment data
Name                           Value
----                           -----
PSVersion                      7.6.2
PSEdition                      Core
GitCommitId                    7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19
OS                             Arch Linux
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Visuals

No response

主要语言
C#
星标
55.5k
派生
8.5k
平均合并
1 天 17 小时
30 天内合并 PR
97

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PowerShell 的其他 Issue

查看 PowerShell/PowerShell 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。