diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 index c401003c2..10a276b32 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 @@ -76,6 +76,18 @@ Describe "Set-Location" -Tags "CI" { $(Get-Location).Path | Should -BeExactly $testPath.FullName } + It "Should use actual casing of folder on case-sensitive filesystem: " -Skip:(!$IsLinux) + { + $dir = "teST" + $testPathLower = New-Item -ItemType Directory -Path (Join-Path $TestDrive $dir.ToLower()) + $testPathUpper = New-Item -ItemType Directory -Path (Join-Path $TestDrive $dir.ToUpper()) + Set-Location $testPathLower.FullName + $(Get-Location).Path | Should -BeExactly $testPathLower.FullName + Set-Location $testPathUpper.FullName + $(Get-Location).Path | Should -BeExactly $testPathUpper.FullName + { Set-Locaiton (Join-Path $TestDrive $dir) } | Should -Throw -ErrorId "PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand" + } + Context 'Set-Location with no arguments' { It 'Should go to $env:HOME when Set-Location run with no arguments from FileSystem provider' {