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 摘要。