Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

HelpSystem.Tests.ps1 cannot handle culture not being defined

Aperta Adatta ai principianti
#27,532 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
powershell
Ambito
testing-qa

Direzione di ricerca

Inizia con test/powershell/engine/Help/HelpSystem.Tests.ps1 intorno alle righe 425 e 434, quindi confronta la gestione della cultura in test/powershell/engine/Help/UpdatableHelpSystem.Tests.ps1 intorno alle righe 438-441. Esegui i test Help interessati con la cultura corrente impostata su Invariant Language (LCID 127). Il lavoro è completato quando entrambi i test full-help superano l’esecuzione senza errori in quell’ambiente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
55.5k
Fork
8.5k
Merge medio
1g 17h
PR unite (30g)
97

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PowerShell

Tutte le issue di PowerShell/PowerShell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.