Note: The problem seems to be in the match-cycling logic, because TabExpansion2 is working properly.
Steps to reproduce
On Linux:
# Switch to a temp dir.
Push-Location (New-Item -Type Directory -Force "temp:/$PID")
# Create two files whose names differ only in case.
$null = New-Item foo.txt, FOO.txt
# Note that the following test SUCCEEDS.
# That is, the TabExpansion2 function correctly finds both names.
(TabExpansion2 './').CompletionMatches.CompletionText | Should -Be './foo.txt', './FOO.txt'
# However, INTERACTIVE CYCLING is broken.
# Type "./" and press TAB to cycle through the matches.
# Currently only *1* name is found.
Code for later cleanup:
Pop-Location; Remove-Item -Recurse "temp:/$PID"
Expected behavior
Tab-completion should cycle through ./foo.txt and /FOO.txt.
Actual behavior
Only one name is found, ./foo.txt
Environment data
PowerShell Core 7.2.0-preview.1