Skip to content

Commit f7f95e7

Browse files
committed
Fix tests logic
1 parent c1939be commit f7f95e7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tests/pester/Syntax.Tests.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@ Describe "Syntax highlighting" {
2525
$stIndex = 0
2626
$errorCounter = 0
2727

28-
$psScopes | %{
29-
while ($stScopes[$stIndex].endOffset -le $_.startOffset) {
28+
foreach ($psScope in $psScopes) {
29+
while ($stScopes[$stIndex].endOffset -le $psScope.startOffset) {
3030
$stIndex++
3131
if ($stIndex -ge $stScopes.Length) {
3232
break
3333
}
3434
}
3535

36+
if ($stIndex -ge $stScopes.Length) {
37+
# we are done with sublime scopes
38+
break
39+
}
40+
3641
$stScope = $stScopes[$stIndex]
37-
$psScope = $_
3842

3943
#Write-Host "PowerShell scope $psScope"
4044
#Write-Host "SublimeText scope $stScope"

0 commit comments

Comments
 (0)