Skip to content

Commit a93aab1

Browse files
committed
Update tab completion test for PowerShell
To avoid over-specify testing.
1 parent b961505 commit a93aab1

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

src/rustup-win-installer/msi/Completion.Tests.ps1

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,13 @@ function Get-Result([string]$Text, [int]$CursorPosition = $Text.Length, [hashtab
99

1010
Describe 'rustup flags and subcommands' {
1111
$result = Get-Result 'rustup '
12-
$result.Count | Should Be 23
13-
$result[00].CompletionText | Should Be 'completions'
14-
$result[01].CompletionText | Should Be 'component'
15-
$result[02].CompletionText | Should Be 'default'
16-
$result[03].CompletionText | Should Be 'doc'
17-
$result[04].CompletionText | Should Be '-h'
18-
$result[05].CompletionText | Should Be 'help'
19-
$result[06].CompletionText | Should Be '--help'
20-
$result[07].CompletionText | Should Be 'install'
21-
$result[08].CompletionText | Should Be 'override'
22-
$result[09].CompletionText | Should Be 'run'
23-
$result[10].CompletionText | Should Be 'self'
24-
$result[11].CompletionText | Should Be 'set'
25-
$result[12].CompletionText | Should Be 'show'
26-
$result[13].CompletionText | Should Be 'target'
27-
$result[14].CompletionText | Should Be 'telemetry'
28-
$result[15].CompletionText | Should Be 'toolchain'
29-
$result[16].CompletionText | Should Be 'uninstall'
30-
$result[17].CompletionText | Should Be 'update'
31-
$result[18].CompletionText | Should Be '-V'
32-
$result[19].CompletionText | Should Be '-v'
33-
$result[20].CompletionText | Should Be '--verbose'
34-
$result[21].CompletionText | Should Be '--version'
35-
$result[22].CompletionText | Should Be 'which'
12+
13+
# Keep it simple because over-specify testing might be risky
14+
$result.Count | Should -BeGreaterThan 10
15+
$result.CompletionText | Should -Contain 'completions'
16+
$result.CompletionText | Should -Contain 'install'
17+
$result.CompletionText | Should -Contain 'uninstall'
18+
$result.CompletionText | Should -Contain 'update'
19+
$result.CompletionText | Should -Contain '--help'
20+
$result.CompletionText | Should -Contain '--verbose'
3621
}

0 commit comments

Comments
 (0)