Skip to content

Commit

Permalink
Add test for file path encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Feb 7, 2017
1 parent 6f0648f commit 5778065
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/TabExpansion.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,32 @@ Describe 'TabExpansion Tests' {
}
}
}
Context 'Add/Reset/Checkout TabExpansion Tests' {
BeforeEach {
$origPath = Get-Location
$temp = [System.IO.Path]::GetTempPath()
$repoPath = Join-Path $temp ([IO.Path]::GetRandomFileName())

git init $repoPath
Set-Location $repoPath
}
AfterEach {
Set-Location $origPath
if (Test-Path $repoPath) {
Remove-Item $repoPath -Recurse -Force
}
}
It 'Tab completes non-ASCII file name' {
git config core.quotepath true # Problematic (default) config

$fileName = "posh$([char]8226)git.txt"
New-Item $fileName

$GitStatus = & $module Get-GitStatus

$result = & $module GitTabExpansionInternal 'git add ' $GitStatus

$result | Should BeExactly $fileName
}
}
}

0 comments on commit 5778065

Please sign in to comment.