mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
fixed indentation
This commit is contained in:
1 parent
11e279d688
commit
c5b90ca656
3 files changed
+78
-88
No files matched your search
@@ -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
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Describe 'Testing of script internationalization' -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
$dir=$PSScriptRoot
|
||||
$defaultParamValues = $PSDefaultParameterValues.Clone()
|
||||
|
||||
@@ -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' {
|
||||
|
||||
Reference in new issue
Block a user