diff --git a/test/powershell/Language/Parser/Conversions.Tests.ps1 b/test/powershell/Language/Parser/Conversions.Tests.ps1 index bfeeddc4f1..119f74d9a8 100644 --- a/test/powershell/Language/Parser/Conversions.Tests.ps1 +++ b/test/powershell/Language/Parser/Conversions.Tests.ps1 @@ -526,7 +526,7 @@ Describe 'method conversion' -Tags 'CI' { } Describe 'float/double precision when converting to string' -Tags "CI" { - It "-to-[string] conversion in PowerShell should use the precision specifier " -TestCases @( + It "-to-[string] conversion in PowerShell should use the precision specifier ()" -TestCases @( @{ SourceType = [double]; Format = "G15"; ValueScript = { 1.1 * 3 }; StringConversionResult = "3.3"; ToStringResult = "3.3000000000000003" } @{ SourceType = [double]; Format = "G15"; ValueScript = { 1.1 * 6 }; StringConversionResult = "6.6"; ToStringResult = "6.6000000000000005" } @{ SourceType = [double]; Format = "G15"; ValueScript = { [System.Math]::E }; StringConversionResult = [System.Math]::E.ToString("G15"); ToStringResult = [System.Math]::E.ToString() } diff --git a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 index 7553fc9620..d78193609b 100644 --- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 +++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 @@ -551,7 +551,8 @@ Describe 'get-help other tests' -Tags "CI" { $x = Get-Help helpFunc11 -det $x.Parameters.parameter | ForEach-Object { - It '$_.description' { $_.description[0].text | Should -Match "^$($_.Name)\s+help" } + $dText = $_.description[0].text + It ('$_.description ({0})' -f $title) { $dText | Should -Match "^$($_.Name)\s+help" } } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 index 665281dd19..9e6c97fae2 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Core/Remove-Module.Tests.ps1 @@ -145,7 +145,7 @@ Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" { } } - It "Remove-Module -FullyQualifiedName " -TestCases $removeModuleByFQNTestCases { + It "Remove-Module -FullyQualifiedName " -TestCases $removeModuleByFQNTestCases { param([Microsoft.PowerShell.Commands.ModuleSpecification[]]$FqnToRemove, [string[]]$ShouldBeRemoved, [string[]]$ShouldBePresent) (Get-Module -Name "Bar", "Baz", "Foo").Name | Should -BeExactly "Bar", "Baz", "Foo", "Foo" @@ -161,7 +161,7 @@ Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" { } } - It "Remove-Module -FullyQualifiedName (Error cases)" -TestCases $removeModuleByFQNErrorTestCases { + It "Remove-Module -FullyQualifiedName (Error cases)" -TestCases $removeModuleByFQNErrorTestCases { param([Microsoft.PowerShell.Commands.ModuleSpecification[]]$FqnToRemove, [string[]]$ShouldBeRemoved, [string[]]$ShouldBePresent) (Get-Module -Name "Bar", "Baz", "Foo").Name | Should -BeExactly "Bar", "Baz", "Foo", "Foo" @@ -177,7 +177,7 @@ Describe "Remove-Module -Name | -FullyQualifiedName | -ModuleInfo" -Tags "CI" { } } - It "Remove-Module -ModuleInfo " -TestCases $removeModuleByFQNTestCases { + It "Remove-Module -ModuleInfo " -TestCases $removeModuleByFQNTestCases { param([Microsoft.PowerShell.Commands.ModuleSpecification[]]$FqnToRemove, [string[]]$ShouldBeRemoved, [string[]]$ShouldBePresent) (Get-Module -Name "Bar", "Baz", "Foo").Name | Should -BeExactly "Bar", "Baz", "Foo", "Foo" diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 index d3c2295fa1..f72f1fc4dd 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Get-Date.Tests.ps1 @@ -56,7 +56,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } # The 'week of year' test cases is from https://en.wikipedia.org/wiki/ISO_week_date - It "using -uformat 'V' produces the correct output" -TestCases @( + It "using -uformat 'V' produces the correct output (:)" -TestCases @( @{date="1998-01-02"; week = "01"}, @{date="1998-01-03"; week = "01"}, @{date="2003-01-03"; week = "01"}, @@ -98,7 +98,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } # Using the same test cases as V for ISO week date component parity, plus some more esoteric ones - It "using -uformat 'G' produces the correct output" -TestCases @( + It "using -uformat 'G' produces the correct output (:)" -TestCases @( @{date="0055-12-31"; year = "0055"}, @{date="0325-01-01"; year = "0325"}, @{date="0777-01-01"; year = "0776"}, @@ -143,7 +143,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } # Using the same test cases as V for ISO week date component parity, plus some more esoteric ones - It "using -uformat 'g' produces the correct output" -TestCases @( + It "using -uformat 'g' produces the correct output (:" -TestCases @( @{date="0055-12-31"; yy = "55"}, @{date="0325-01-01"; yy = "25"}, @{date="0777-01-01"; yy = "76"}, @@ -188,7 +188,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { } # Using the same test cases as V for ISO week date component parity - It "using -uformat 'u' produces the correct output" -TestCases @( + It "using -uformat 'u' produces the correct output (:)" -TestCases @( @{date="1998-01-02"; dayOfWeek = "5"}, @{date="1998-01-03"; dayOfWeek = "6"}, @{date="2003-01-03"; dayOfWeek = "5"}, @@ -228,7 +228,7 @@ Describe "Get-Date DRT Unit Tests" -Tags "CI" { param($date, $dayOfWeek) Get-Date -Date $date -UFormat %u | Should -BeExactly $dayOfWeek } - It "Passing '' to -uformat produces a descriptive error" -TestCases @( + It "Passing '' to -uformat produces a descriptive error ()" -TestCases @( @{ name = "`$null" ; value = $null; errorId = "ParameterArgumentValidationErrorNullNotAllowed" } @{ name = "empty string"; value = ""; errorId = "ParameterArgumentValidationErrorEmptyStringNotAllowed" } ) { @@ -286,11 +286,11 @@ Describe "Get-Date" -Tags "CI" { Get-Date -Date 0030-01-01T01:02:03.0004 -Format FileDateTime | Should -Be "00300101T0102030004" } - It "-Format FileDateTimeUniversal works" { + It "-Format FileDateTimeUniversal works (1)" { Get-Date -Date 0030-01-01T01:02:03.0004z -Format FileDateTimeUniversal | Should -Be "00300101T0102030004Z" } - It "-Format FileDateTimeUniversal works" { + It "-Format FileDateTimeUniversal works (2)" { Get-Date -Date 0030-01-01T01:02:03.0004z -Format FileDateUniversal | Should -Be "00300101Z" } @@ -324,7 +324,7 @@ Describe "Get-Date" -Tags "CI" { $timeDifference.Ticks | Should -BeLessThan 10000 } - It "-UnixTimeSeconds works" -TestCases @( + It "-UnixTimeSeconds works ()" -TestCases @( @{ UnixTimeSeconds = 1577836800; Expected = [System.DateTimeOffset]::FromUnixTimeSeconds(1577836800).LocalDateTime }, @{ UnixTimeSeconds = 0; Expected = [System.DateTimeOffset]::UnixEpoch.LocalDateTime }, @{ UnixTimeSeconds = -1; Expected = [System.DateTimeOffset]::FromUnixTimeSeconds(-1).LocalDateTime } @@ -360,7 +360,7 @@ Describe "Get-Date -UFormat tests" -Tags "CI" { $timeZone1 = [String]::Format("{0:+00;-00}", [Timezone]::CurrentTimeZone.GetUtcOffset( $date1 ).Hours) } - It "Get-Date -UFormat " -TestCases @( + It "Get-Date -UFormat ()" -TestCases @( # Some format specifiers is locale sensetive: # - and tests work on EN-US only # - and can not be full compatible with Unix 'date' utility. diff --git a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 index 1dd49f56ec..7e84b964b9 100644 --- a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 @@ -18,12 +18,12 @@ Describe "BooleanParameterDCR Tests" -tags "CI" { } $tests = @( - @{ inputTest = 0; expected = $false }, - @{ inputTest = 000; expected = $false }, - @{ inputTest = 0x00; expected = $false }, - @{ inputTest = 0.00; expected = $false } + @{ inputTest = 0; expected = $false; iteration = 1 }, + @{ inputTest = 000; expected = $false; iteration = 2 }, + @{ inputTest = 0x00; expected = $false; iteration = 3 }, + @{ inputTest = 0.00; expected = $false; iteration = 4 } ) - It "Test that passing zero works as the value for a Switch parameter, inputTest:,expect:" -TestCases $tests { + It "Test that passing zero works as the value for a Switch parameter, inputTest:,expect:" -TestCases $tests { param ( $inputTest, $expected ) [bool]$switchTestParam = $inputTest $result = ParserTestSwitchCmdlet -switchParam:$switchTestParam @@ -31,11 +31,11 @@ Describe "BooleanParameterDCR Tests" -tags "CI" { } $tests = @( - @{ inputTest = $(1 -eq 1); expected = $true }, - @{ inputTest = $true; expected = $true }, - @{ inputTest = $TRUE; expected = $true } + @{ inputTest = $(1 -eq 1); expected = $true; iteration = 1}, + @{ inputTest = $true; expected = $true; iteration = 2}, + @{ inputTest = $TRUE; expected = $true; iteration = 3} ) - It "Test that $true is accepted as a true value for Switch parameters, inputTest:,expect:" -TestCases $tests { + It "Test that $true is accepted as a true value for Switch parameters, inputTest:,expect:" -TestCases $tests { param ( $inputTest, $expected ) [bool]$switchTestParam = $inputTest $result = ParserTestSwitchCmdlet -switchParam:$switchTestParam