Repository navigation
Make TabCompletion case-insensitive for file names on Unix (2-nd attempt) - #7221
Ilya (iSazonov) wants to merge 4 commits into
Conversation
adaddb9 to
313755d
Compare
bf9a4d5 to
be262de
Compare
|
Steve Lee (@SteveL-MSFT) sergei (@vors) Can we review and merge the PR before 6.1? |
| Push-Location -Path $tempDir | ||
| $res = TabExpansion2 -inputScript $oneSubDirLowerTest -cursorColumn $oneSubDirLowerTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should Be ".${separator}$oneSubDirTest" |
There was a problem hiding this comment.
I would expect the result casing to match the actual casing. Use -BeExactly
| $res.CompletionMatches[0].CompletionText | Should Be ".${separator}$oneSubDirTest" | ||
|
|
||
| $res = TabExpansion2 -inputScript $oneSubDirUpperTest -cursorColumn $oneSubDirUpperTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 |
There was a problem hiding this comment.
Shouldn't we know exactly the number of expected completions?
There was a problem hiding this comment.
For this fix, it does not matter count (the check is only protection from exception in next line) - the order is important.
There was a problem hiding this comment.
Since this test created the folder structure, the number of completions should be the same each time, right?
There was a problem hiding this comment.
Yes. Count check was added.
|
|
||
| $res = TabExpansion2 -inputScript $oneSubDirUpperTest -cursorColumn $oneSubDirUpperTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should Be ".${separator}$oneSubDirTest" |
| It "TabCompletion should be case-sensitive for file names on Unix" -Skip:(!$IsLinux) { | ||
| Push-Location -Path $tempDir | ||
| $res = TabExpansion2 -inputScript $oneSubDirLowerTest -cursorColumn $oneSubDirLowerTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 |
There was a problem hiding this comment.
Shouldn't we know exactly the number of expected completions?
| Push-Location -Path $tempDir | ||
| $res = TabExpansion2 -inputScript $oneSubDirLowerTest -cursorColumn $oneSubDirLowerTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should BeExactly ".${separator}$oneSubDirTest" |
| $res.CompletionMatches[0].CompletionText | Should BeExactly ".${separator}$oneSubDirTest" | ||
|
|
||
| $res = TabExpansion2 -inputScript $oneSubDirUpperTest -cursorColumn $oneSubDirUpperTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 |
There was a problem hiding this comment.
Shouldn't we know exactly how many results we should get since we control the folder structure?
|
|
||
| $res = TabExpansion2 -inputScript $oneSubDirUpperTest -cursorColumn $oneSubDirUpperTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 | ||
| $res.CompletionMatches[0].CompletionText | Should BeExactly ".${separator}$oneSubDirTest2" |
| It "TabCompletion should be case-insensitive for file names on Windows and MacOS" -Skip:($IsLinux) { | ||
| Push-Location -Path $tempDir | ||
| $res = TabExpansion2 -inputScript $oneSubDirLowerTest -cursorColumn $oneSubDirLowerTest.Length | ||
| $res.CompletionMatches.Count | Should BeGreaterThan 0 |
There was a problem hiding this comment.
Shouldn't we know exactly the number of expected completions?
| It "TabCompletion should be case-sensitive for file names on Unix" -Skip:(!$IsLinux) { | ||
| Push-Location -Path $tempDir | ||
| $res = TabExpansion2 -inputScript $oneSubDirLowerTest -cursorColumn $oneSubDirLowerTest.Length | ||
| $res.CompletionMatches | Should -HaveCount 2 |
There was a problem hiding this comment.
This should still be -HaveCount 1? You're testing that "onesubd" and "oneSubD" both return "onesubdir", right?
It seems we should have a test for Linux for a directory structure like:
testfolder
testFolder
and tabcomplete off test should return two results
There was a problem hiding this comment.
This additional test case is still needed.
There was a problem hiding this comment.
Steve Lee (@SteveL-MSFT) It is already there - see line 226. So I removed last commit. Seems my solution is not full - the count should be 2 on .
How can I get the artifact (compiled PowerShell) from CI Travis?
There was a problem hiding this comment.
Ilya (@iSazonov) you're right, I misunderstood that test. Did a little investigation and it appears that the change to GetFileSystemEntries() is not sufficient as a call to Resolve-Path earlier only returns case-sensitive matches on Linux.
There was a problem hiding this comment.
Steve Lee (@SteveL-MSFT) Should we open new issue to discuss making Resolve-Path case-insensitive? This is most likely to affect globbing whole.
There was a problem hiding this comment.
Ilya (@iSazonov) we should probably have a new issue for Resolve-Path. May need to add a -CaseInsensitive switch to maintain backwards compatibility.
e1c394b to
8e3f64e
Compare
|
This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days. |
|
I considered Michael Klement (@mklement0) Maybe you have any thoughts about this? |
|
This PR has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs within 10 days. |
|
This PR has be automatically close because it is stale. If you wish to continue working on the PR, please first update the PR, then reopen it. |
|
The fix needs changes in some API levels. It is a lot of work... |
PR Summary
Attempt to fix #1273.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests