Fix the tab completion tests (#20867)

This commit is contained in:
Dongbo Wang
2023-12-07 15:53:22 -08:00
committed by GitHub
parent 1393d167f5
commit cfc3a29426
@@ -1297,7 +1297,7 @@ class InheritedClassTest : System.Attribute
Context "Cmdlet name completion" {
BeforeAll {
$testCases = @(
@{ inputStr = "get-c*item"; expected = "Get-ChildItem" }
@{ inputStr = "get-ch*item"; expected = "Get-ChildItem" }
@{ inputStr = "set-alia?"; expected = "Set-Alias" }
@{ inputStr = "s*-alias"; expected = "Set-Alias" }
@{ inputStr = "se*-alias"; expected = "Set-Alias" }
@@ -1988,7 +1988,7 @@ dir -Recurse `
}
It "Test complete module file name" {
$inputStr = "using module test"
$inputStr = "using module testm"
$res = TabExpansion2 -inputScript $inputStr -cursorColumn $inputStr.Length
$res.CompletionMatches | Should -HaveCount 1
$res.CompletionMatches[0].CompletionText | Should -BeExactly ".${separator}testModule.psm1"