Files
PowerShell/test/powershell/Language/Scripting/TestsOnWinFullOnly.ps1
T

32 lines
955 B
PowerShell
Raw Normal View History

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
function Run-TestOnWinFull
2016-09-12 10:43:53 -07:00
{
[CmdletBinding()]
param( [string]$name )
2017-01-16 13:31:14 -08:00
switch ($name)
2016-09-12 10:43:53 -07:00
{
"ActionPreference:ErrorAction=SuspendOnWorkflow" {
workflow TestErrorActionSuspend { "Hello" }
2017-01-16 13:31:14 -08:00
2016-09-12 10:43:53 -07:00
$r = TestErrorActionSuspend -ErrorAction Suspend
2017-01-16 13:31:14 -08:00
$r | Should -BeExactly 'Hello'
2016-09-12 10:43:53 -07:00
break; }
"ForeachParallel:ASTOfParallelForeachOnWorkflow" {
Import-Module PSWorkflow
$errors = @()
$ast = [System.Management.Automation.Language.Parser]::ParseInput(
'workflow foo { foreach -parallel ($foo in $bar) {} }', [ref] $null, [ref] $errors)
$errors.Count | Should -Be 0
$ast.EndBlock.Statements[0].Body.EndBlock.Statements[0].Flags | Should -BeExactly 'Parallel'
2016-09-12 10:43:53 -07:00
break;
}
default {
#do nothing
}
2017-01-16 13:31:14 -08:00
2016-09-12 10:43:53 -07:00
}
2020-01-13 18:36:47 +00:00
}