add case-sensitive test

This commit is contained in:
Steve Lee (POWERSHELL) 2019-03-30 09:40:14 -07:00
parent f0264d0147
commit 882e94f1cb

View file

@ -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: <dir>" -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' {