Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions debug.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Import-Module PesterConverter -Force
Convert-PesterSyntax -Path 'tests/Integration/Syntax/v5/ShouldInvoke.Debug.v5.tests.ps1' -Pester6 -Verbose -PassThru
6 changes: 4 additions & 2 deletions source/Private/Convert-AssertMockCalled.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ function Convert-AssertMockCalled

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_AssertMockCalled_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_AssertMockCalled_Debug_ParsingCommandAst -f $extentText)

$sourceSyntaxVersion = Get-PesterCommandSyntaxVersion -CommandAst $CommandAst

Expand Down Expand Up @@ -244,7 +246,7 @@ function Convert-AssertMockCalled
}
}

Write-Debug -Message ($script:localizedData.Convert_AssertMockCalled_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_AssertMockCalled_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBe

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -188,7 +190,7 @@ function Convert-ShouldBe
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeExactly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeExactly

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -191,7 +193,7 @@ function Convert-ShouldBeExactly
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeFalse.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ function Convert-ShouldBeFalse

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -181,7 +183,7 @@ function Convert-ShouldBeFalse
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeGreaterOrEqual.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeGreaterOrEqual

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -188,7 +190,7 @@ function Convert-ShouldBeGreaterOrEqual
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeGreaterThan.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ function Convert-ShouldBeGreaterThan

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -196,7 +198,7 @@ function Convert-ShouldBeGreaterThan
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeIn.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeIn

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -232,7 +234,7 @@ function Convert-ShouldBeIn
$newExtentText = '{0} | {1}' -f $commandParameters.ActualValue.ExtentText, $newExtentText
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeLessOrEqual.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeLessOrEqual

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -188,7 +190,7 @@ function Convert-ShouldBeLessOrEqual
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeLessThan.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ function Convert-ShouldBeLessThan

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -196,7 +198,7 @@ function Convert-ShouldBeLessThan
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeLike.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeLike

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -187,7 +189,7 @@ function Convert-ShouldBeLike
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeLikeExactly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldBeLikeExactly

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -190,7 +192,7 @@ function Convert-ShouldBeLikeExactly
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeNullOrEmpty.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ function Convert-ShouldBeNullOrEmpty

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -189,7 +191,7 @@ function Convert-ShouldBeNullOrEmpty
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeOfType.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ function Convert-ShouldBeOfType

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -208,7 +210,7 @@ function Convert-ShouldBeOfType
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldBeTrue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function Convert-ShouldBeTrue

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -184,7 +186,7 @@ function Convert-ShouldBeTrue
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldContain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ function Convert-ShouldContain

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -188,7 +190,7 @@ function Convert-ShouldContain
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
10 changes: 6 additions & 4 deletions source/Private/Convert-ShouldHaveCount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ function Convert-ShouldHaveCount

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand All @@ -90,9 +92,9 @@ function Convert-ShouldHaveCount
# Negated tests are not supported.
if ($isNegated)
{
Write-Verbose -Message ($script:localizedData.Convert_HaveCount_Error_NegatedTestsNotSupported -f $CommandAst.Extent.Text)
Write-Verbose -Message ($script:localizedData.Convert_HaveCount_Error_NegatedTestsNotSupported -f $extentText)

return $CommandAst.Extent.Text
return $extentText
}

# Add the correct Pester 6 command name
Expand Down Expand Up @@ -200,7 +202,7 @@ function Convert-ShouldHaveCount
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldInvoke.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function Convert-ShouldInvoke

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated.
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -180,7 +182,7 @@ function Convert-ShouldInvoke
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldMatch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ function Convert-ShouldMatch

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -188,7 +190,7 @@ function Convert-ShouldMatch
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
6 changes: 4 additions & 2 deletions source/Private/Convert-ShouldMatchExactly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function Convert-ShouldMatchExactly

Assert-BoundParameter @assertBoundParameterParameters

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $CommandAst.Extent.Text)
$extentText = Get-ExtentText -CommandAst $CommandAst

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ParsingCommandAst -f $extentText)

# Determine if the command is negated
$isNegated = Test-PesterCommandNegated -CommandAst $CommandAst
Expand Down Expand Up @@ -191,7 +193,7 @@ function Convert-ShouldMatchExactly
}
}

Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $CommandAst.Extent.Text, $newExtentText)
Write-Debug -Message ($script:localizedData.Convert_Should_Debug_ConvertedCommand -f $extentText, $newExtentText)

return $newExtentText
}
Loading
Loading