From c5b90ca6564dd7a33dbfc77edd9a3bfc2c6f0343 Mon Sep 17 00:00:00 2001 From: Yanbing Wang Date: Fri, 2 Sep 2016 13:28:20 -0700 Subject: [PATCH] fixed indentation --- .../Language/Parser/Parsing.Tests.ps1 | 19 +-- .../Language/Scripting/I18n.Tests.ps1 | 1 - .../Language/Scripting/ScriptHelp.Tests.ps1 | 146 +++++++++--------- 3 files changed, 78 insertions(+), 88 deletions(-) diff --git a/test/powershell/Language/Parser/Parsing.Tests.ps1 b/test/powershell/Language/Parser/Parsing.Tests.ps1 index f96a6604dd..51a886e52f 100644 --- a/test/powershell/Language/Parser/Parsing.Tests.ps1 +++ b/test/powershell/Language/Parser/Parsing.Tests.ps1 @@ -164,9 +164,9 @@ Describe 'named blocks parsing' -Tags "CI" { Test-Ast 'begin {} end' 'begin {} end' 'begin {}' 'end' } - # - # data statement - # +# +# data statement +# Describe 'data statement parsing' -Tags "CI" { ShouldBeParseError 'data' MissingStatementBlockForDataSection 5 -CheckColumnNumber ShouldBeParseError 'data foo' MissingStatementBlockForDataSection 9 -CheckColumnNumber @@ -188,10 +188,9 @@ Describe 'data statement parsing' -Tags "CI" { Test-ErrorStmt 'data -s a,b' 'data -s a,b' 'a' 'b' } - # - # try/catch/finally statement - # - +# +# try/catch/finally statement +# Describe 'try/catch/finally statement parsing' -Tags "CI" { ShouldBeParseError 'try' MissingTryStatementBlock 3 ShouldBeParseError 'try {}' MissingCatchOrFinally 6 @@ -216,7 +215,6 @@ Describe 'try/catch/finally statement parsing' -Tags "CI" { Test-ErrorStmt 'try {1} catch [int],' 'try {1} catch [int],' '{1}' '1' '1' '1' '[int]' } - Describe 'switch statement parsing' -Tags "CI" { ShouldBeParseError 'switch' PipelineValueRequired 6 ShouldBeParseError 'switch -abc' InvalidSwitchFlag,PipelineValueRequired 7,11 @@ -277,7 +275,6 @@ Describe 'splatting parsing' -Tags "CI" { ShouldBeParseError 'function foo (@a) {}' SplattingNotPermitted 14 } - Describe 'Pipes parsing' -Tags "CI" { ShouldBeParseError 'gps|' EmptyPipeElement 4 ShouldBeParseError '1|1' ExpressionsMustBeFirstInPipeline 2 @@ -291,15 +288,11 @@ Describe 'commands parsing' -Tags "CI" { ShouldBeParseError 'gcm ,' MissingArgument 4 } - # - # tokens - # Describe 'tokens parsing' -Tags "CI" { ShouldBeParseError ' )' UnexpectedToken 3 ShouldBeParseError ' }' UnexpectedToken 4 -CheckColumnNumber } - Describe 'expressions parsing' -Tags "CI" { ShouldBeParseError '1+' ExpectedValueExpression 2 ShouldBeParseError '[a()][b]' UnexpectedAttribute 0 diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 index 09b67b6db3..e3ec39e98b 100644 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ b/test/powershell/Language/Scripting/I18n.Tests.ps1 @@ -1,5 +1,4 @@ Describe 'Testing of script internationalization' -Tags "CI" { - BeforeAll { $dir=$PSScriptRoot $defaultParamValues = $PSDefaultParameterValues.Clone() diff --git a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 index 02bb96063b..b7ec502157 100644 --- a/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 +++ b/test/powershell/Language/Scripting/ScriptHelp.Tests.ps1 @@ -1,5 +1,4 @@  Describe 'get-help HelpFunc1' -Tags "CI" { - BeforeAll { function TestHelpError { [CmdletBinding()] @@ -154,15 +153,15 @@ Describe 'get-help file' -Tags "CI" { # Note - 2 blank lines below are intentional, do not delete @' - # .SYNOPSIS - # Script help, not function help + # .SYNOPSIS + # Script help, not function help - function foo - { - } + function foo + { + } - get-help foo + get-help foo '@ > $tmpfile $x = get-help $tmpfile @@ -173,7 +172,6 @@ Describe 'get-help file' -Tags "CI" { } Describe 'get-help other tests' -Tags "CI" { - BeforeAll { try { $tempFile = [IO.Path]::ChangeExtension([IO.Path]::GetTempFileName(), "ps1") @@ -216,19 +214,19 @@ Describe 'get-help other tests' -Tags "CI" { } Context 'get-help file and get-help helpFunc2' { - $script = @" - <# - .SYNOPSIS - This is script help - #> + $script = @" + <# + .SYNOPSIS + This is script help + #> - <# - .SYNOPSIS - This is function help for helpFunc2 - #> - function helpFunc2 {} + <# + .SYNOPSIS + This is function help for helpFunc2 + #> + function helpFunc2 {} - get-help helpFunc2 + get-help helpFunc2 "@ Set-Content $tempFile $script @@ -241,18 +239,18 @@ Describe 'get-help other tests' -Tags "CI" { Context 'get-help file and get-help helpFunc2' { $script = @" - # - # .SYNOPSIS - # This is script help - # + # + # .SYNOPSIS + # This is script help + # - # - # .SYNOPSIS - # This is function help for helpFunc2 - # - function helpFunc2 {} + # + # .SYNOPSIS + # This is function help for helpFunc2 + # + function helpFunc2 {} - get-help helpFunc2 + get-help helpFunc2 "@ Set-Content $tempFile $script @@ -266,28 +264,28 @@ Describe 'get-help other tests' -Tags "CI" { Context 'get-help psuedo file' { $script = @' - ########################################### - # - # Psuedo-Copyright header comment - # - ########################################### + ########################################### + # + # Psuedo-Copyright header comment + # + ########################################### - #requires -version 2.0 + #requires -version 2.0 - # - # .Synopsis - # Changes Admin passwords across all KDE servers. - # - [CmdletBinding(DefaultParameterSetName="Live")] - param( - [Parameter( - ParameterSetName="Live", - Mandatory=$true)] - $live, - [Parameter( - ParameterSetName="Test", - Mandatory=$true)] - $test) + # + # .Synopsis + # Changes Admin passwords across all KDE servers. + # + [CmdletBinding(DefaultParameterSetName="Live")] + param( + [Parameter( + ParameterSetName="Live", + Mandatory=$true)] + $live, + [Parameter( + ParameterSetName="Test", + Mandatory=$true)] + $test) '@ Set-Content $tempFile $script @@ -452,41 +450,41 @@ Describe 'get-help other tests' -Tags "CI" { } Context 'get-help helpFunc11' { - function helpFunc11 - { - # .Synopsis - # - # useless, sorry + function helpFunc11 + { + # .Synopsis + # + # useless, sorry - param( + param( - # not in help + # not in help - <# abc #><# help #> [parameter()] [string] - $abc, + <# abc #><# help #> [parameter()] [string] + $abc, - [string] - # def help - $def, + [string] + # def help + $def, - [parameter()] - # ghi help - $ghi, + [parameter()] + # ghi help + $ghi, - # jkl help + # jkl help - $jkl, + $jkl, - <#mno help#>$mno, - <#pqr help#>[int]$pqr + <#mno help#>$mno, + <#pqr help#>[int]$pqr - ) - } + ) + } - $x = get-help helpFunc11 -det - $x.Parameters.parameter | % { - It '$_.description' { $_.description[0].text | Should match "^$($_.Name)\s+help" } - } + $x = get-help helpFunc11 -det + $x.Parameters.parameter | % { + It '$_.description' { $_.description[0].text | Should match "^$($_.Name)\s+help" } + } } Context 'get-help helpFunc12' {