Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module.
# This is a Pester test suite to validate the Format-Hex cmdlet in the Microsoft.PowerShell.Utility module.
#
# Copyright (c) Microsoft Corporation, 2015
#
Expand Down Expand Up @@ -38,7 +38,7 @@ function RunObjectFromPipelineTestCase($testCase)
$result | Should BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
$result[0].ToString() | Should Match $testCase.ExpectedResult

if ($result.count > 1)
if ($result.count -gt 1)
{
$result[1].ToString() | Should Match $testCase.ExpectedSecondResult
}
Expand All @@ -51,7 +51,7 @@ function RunPathAndLiteralPathParameterTestCase($testCase)

if ($testCase.PathCase)
{
$result = Format-Hex -Path $testCase.Path
$result = Format-Hex -Path $testCase.Path
}
else # LiteralPath
{
Expand All @@ -62,9 +62,14 @@ function RunPathAndLiteralPathParameterTestCase($testCase)
$result | Should BeOfType 'Microsoft.PowerShell.Commands.ByteCollection'
$result[0].ToString() | Should Match $testCase.ExpectedResult

if ($result.count > 1)
if ($result.count -gt 1)
{
$result[1].ToString() | Should Match $testCase.ExpectedSecondResult
$expectedResult = $testCase.ExpectedSecondResult
if ($expectedResult.Length -gt 16) # content larger than 16 bytes show up in next row
{
$expectedResult = $expectedResult.SubString(0, 16)
}
$result[1].ToString() | Should Match $expectedResult
}
}
}
Expand Down