-
-
Notifications
You must be signed in to change notification settings - Fork 811
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tab expansion to handle params for push.
Fix #234 BTW if we decide this is an OK fix (need another set of eyes on my $gitParams regex), I'd like to review the fact that all these switch regex case statements fallthrough to the next (observed while debugging tab expansion). I don't believe that is necessary. I'm thinking that most (all) of these should have a break statement. Started a minimum set of Pester tests for tab completion. Would be good to flesh these out over time. Add debug configuration for VSCode that is dedicated to debugging Pester tests.
- Loading branch information
1 parent
5ada37f
commit 87afebd
Showing
4 changed files
with
83 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,28 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "PowerShell", | ||
"request": "launch", | ||
"name": "PowerShell Launch Pester Tests", | ||
"script": "${workspaceRoot}/test/testDebugHarness.ps1", | ||
"args": [], | ||
"cwd": "${file}" | ||
}, | ||
{ | ||
"type": "PowerShell", | ||
"request": "launch", | ||
"name": "PowerShell Launch (current file)", | ||
"script": "${file}", | ||
"args": [], | ||
"cwd": "${file}" | ||
}, | ||
{ | ||
"type": "PowerShell", | ||
"request": "attach", | ||
"name": "PowerShell Attach to Host Process", | ||
"processId": "${command.PickPSHostProcess}", | ||
"runspaceId": 1 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
. $PSScriptRoot\Shared.ps1 | ||
|
||
Describe 'TabExpansion Tests' { | ||
Context 'Fetch/Push/Pull TabExpansion Tests' { | ||
It 'Tab completes all remotes' { | ||
$result = & $module GitTabExpansionInternal 'git push ' | ||
$result | Should BeExactly 'origin' | ||
} | ||
It 'Tab completes matching remotes' { | ||
$result = & $module GitTabExpansionInternal 'git push or' | ||
$result | Should BeExactly 'origin' | ||
} | ||
It 'Tab completes remote and all branches' { | ||
$result = & $module GitTabExpansionInternal 'git push origin ' | ||
$result -contains 'master' | Should Be $true | ||
$result -contains 'origin/master' | Should Be $true | ||
$result -contains 'origin/HEAD' | Should Be $true | ||
} | ||
It 'Tab completes remote and matching branches' { | ||
$result = & $module GitTabExpansionInternal 'git push origin ma' | ||
$result | Should BeExactly 'master' | ||
} | ||
It 'Tab completes matching remote with preceding parameters' { | ||
$result = & $module GitTabExpansionInternal 'git push --follow-tags -u or' | ||
$result | Should BeExactly 'origin' | ||
} | ||
It 'Tab completes remote and all branches with preceding parameters' { | ||
$result = & $module GitTabExpansionInternal 'git push --follow-tags -u origin ' | ||
$result -contains 'master' | Should Be $true | ||
$result -contains 'origin/master' | Should Be $true | ||
$result -contains 'origin/HEAD' | Should Be $true | ||
} | ||
It 'Tab completes remote and matching branch with preceding parameters' { | ||
$result = & $module GitTabExpansionInternal 'git push --follow-tags -u origin ma' | ||
$result | Should BeExactly 'master' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
Invoke-Pester $PSScriptRoot\Utils.Tests.ps1 | ||
Invoke-Pester $PSScriptRoot |