HelpSystem.Tests.ps1 cannot handle culture not being defined
还没有人认领这个 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 内容生成。
描述
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PowerShell/PowerShell 的其他 Issue
-
Issue-Enhancement Needs-Triage
难度 1/5 1 小时以内 新手友好度 86/100
PowerShell/PowerShell#28061 · 2 个 reaction ·
-
难度 1/5 1 小时以内 新手友好度 90/100
PowerShell/PowerShell#28037 ·
-
Needs-Triage
难度 2/5 1-3 小时 新手友好度 74/100
PowerShell/PowerShell#27973 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
PowerShell/PowerShell#27720 ·
-
Issue-Bug Up-for-Grabs WG-Cmdlets WG-Reviewed
难度 2/5 1-3 小时 新手友好度 72/100
PowerShell/PowerShell#27670 · 3 条评论 ·
查看 PowerShell/PowerShell 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
nightscout/nocturne#1425 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
RayWangQvQ/BiliBiliToolPro#1137 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100