From 604224f2e35bc7a2628548af996c887b43fda7a7 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 8 Jul 2019 11:35:49 -0700 Subject: [PATCH] Merged PR 8529: Make Hashtable case insensitivity test use current culture rather than shell to set culture --- .../Parser/LanguageAndParser.TestFollowup.Tests.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 index edc6a297be..e42e06c2a4 100644 --- a/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 +++ b/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 @@ -305,7 +305,15 @@ Describe "Hash expression with if statement as value" -Tags "CI" { } Describe "Hashtable is case insensitive" -Tag CI { - It "When LANG is C.UTF-8" -Skip:($IsWindows) { - sh -c 'LANG=C.UTF-8 pwsh -NoProfile -Command ''$h=@{p=1};$h.P''' | Should -Be 1 + It "When current culture is en-US-POSIX" -Skip:($IsWindows) { + try { + $oldCulture = [System.Globalization.CultureInfo]::CurrentCulture + [System.Globalization.CultureInfo]::CurrentCulture = [System.Globalization.CultureInfo]::new('en-US-POSIX') + + @{h=1}.H | Should -Be 1 -Because 'hashtables should be case insensitive in en-US-POSIX culture' + } + finally { + [System.Globalization.CultureInfo]::CurrentCulture = $oldCulture + } } }