mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Update 'CommandNotFound' fuzzy suggestion to only return unique results (#8640)
This commit is contained in:
1 parent
812456f84c
commit
c3cb6df809
2 files changed
+7
-6
No files matched your search
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
Describe "Get-Command CI tests" -Tag Feature {
|
||||
Describe "Get-Command Feature tests" -Tag Feature {
|
||||
Context "-UseFuzzyMatch tests" {
|
||||
It "Should match cmdlets" {
|
||||
$cmds = Get-Command get-hlp -UseFuzzyMatch
|
||||
@@ -10,14 +10,15 @@ Describe "Get-Command CI tests" -Tag Feature {
|
||||
}
|
||||
|
||||
It "Should match native commands" {
|
||||
$ping = "ping"
|
||||
$input = "pwsg"
|
||||
$expectedcmd = "pwsh"
|
||||
if ($IsWindows) {
|
||||
$ping = "PING.EXE"
|
||||
$expectedcmd = "pwsh.EXE"
|
||||
}
|
||||
|
||||
$cmds = Get-Command pinh -UseFuzzyMatch
|
||||
$cmds = Get-Command $input -UseFuzzyMatch
|
||||
$cmds.Count | Should -BeGreaterThan 0
|
||||
$cmds.Name | Should -Contain $ping
|
||||
$cmds.Name | Should -Contain $expectedcmd
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user