From a454352f32c287054d5df4dedcccdc1e7b03cb4f Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Mon, 13 Jan 2020 19:39:58 +0000 Subject: [PATCH] Fix false positives --- test/powershell/Host/ConsoleHost.Tests.ps1 | 12 ++++++------ .../Classes/Scripting.Classes.BasicParsing.Tests.ps1 | 6 +++--- .../ParameterBinding/BooleanParameterDCR.Tests.ps1 | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/powershell/Host/ConsoleHost.Tests.ps1 b/test/powershell/Host/ConsoleHost.Tests.ps1 index 9b4f9e444d..5a71d41f52 100644 --- a/test/powershell/Host/ConsoleHost.Tests.ps1 +++ b/test/powershell/Host/ConsoleHost.Tests.ps1 @@ -185,8 +185,8 @@ Describe "ConsoleHost unit tests" -tags "Feature" { It "-File should be able to pass bool string values as string to parameters: " -TestCases @( # validates case is preserved - @{BoolString = '$true'}, - @{BoolString = '$false'}, + @{BoolString = '$truE'}, + @{BoolString = '$falSe'}, @{BoolString = 'trUe'}, @{BoolString = 'faLse'} ) { @@ -198,8 +198,8 @@ Describe "ConsoleHost unit tests" -tags "Feature" { It "-File should be able to pass bool string values as string to positional parameters: " -TestCases @( # validates case is preserved - @{BoolString = '$true'}, - @{BoolString = '$false'}, + @{BoolString = '$tRue'}, + @{BoolString = '$falSe'}, @{BoolString = 'tRUe'}, @{BoolString = 'fALse'} ) { @@ -210,8 +210,8 @@ Describe "ConsoleHost unit tests" -tags "Feature" { } It "-File should be able to pass bool string values as bool to switches: " -TestCases @( - @{BoolString = '$true'; BoolValue = 'True'}, - @{BoolString = '$false'; BoolValue = 'False'}, + @{BoolString = '$tRue'; BoolValue = 'True'}, + @{BoolString = '$faLse'; BoolValue = 'False'}, @{BoolString = 'tRue'; BoolValue = 'True'}, @{BoolString = 'fAlse'; BoolValue = 'False'} ) { diff --git a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 index a0ab1e08d2..a3dae18f94 100644 --- a/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 +++ b/test/powershell/Language/Classes/Scripting.Classes.BasicParsing.Tests.ps1 @@ -225,13 +225,13 @@ Describe 'Positive Parse Properties Tests' -Tags "CI" { [void] m() { $LASTEXITCODE - $LASTEXITCODE + $lastexitcode '111' -Match '1' $Matches - $Matches + $mAtches $error[0] $error - $PWD + $pwd foreach ($i in 1..10) {$foreach} switch ($i) { diff --git a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 index e2a44b929a..595cff8ba9 100644 --- a/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 +++ b/test/powershell/engine/ParameterBinding/BooleanParameterDCR.Tests.ps1 @@ -33,7 +33,7 @@ Describe "BooleanParameterDCR Tests" -tags "CI" { $tests = @( @{ inputTest = $(1 -eq 1); expected = $true }, @{ inputTest = $true; expected = $true }, - @{ inputTest = $true; expected = $true } + @{ inputTest = $TRUE; expected = $true } ) It "Test that $true is accepted as a true value for Switch parameters, inputTest:,expect:" -TestCases $tests { param ( $inputTest, $expected )