mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Update based on PR feedback
This commit is contained in:
1 parent
b488d7eb35
commit
11e279d688
1 file changed
+8
-8
@@ -130,9 +130,9 @@ Describe 'Testing of script internationalization' -Tags "CI" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$testData = @(
|
$testData = @(
|
||||||
@{cmd = 'data d { @{ x=$(get-command)} }';Expected='*get-command*'},
|
@{cmd = 'data d { @{ x=$(get-command)} }';Expected='get-command'},
|
||||||
@{cmd = 'data d { if ($(get-command)) {} }';Expected='*get-command*'},
|
@{cmd = 'data d { if ($(get-command)) {} }';Expected='get-command'},
|
||||||
@{cmd = 'data d { @(get-command) }';Expected='*get-command*'}
|
@{cmd = 'data d { @(get-command) }';Expected='get-command'}
|
||||||
)
|
)
|
||||||
|
|
||||||
It 'Allowed cmdlets checked properly' -TestCase:$testData {
|
It 'Allowed cmdlets checked properly' -TestCase:$testData {
|
||||||
@@ -141,18 +141,18 @@ Describe 'Testing of script internationalization' -Tags "CI" {
|
|||||||
$script:exception = $null
|
$script:exception = $null
|
||||||
& {
|
& {
|
||||||
trap {$script:exception = $_.Exception ; continue }
|
trap {$script:exception = $_.Exception ; continue }
|
||||||
iex $cmd
|
invoke-expression $cmd
|
||||||
}
|
}
|
||||||
#$exception -like '*get-command*' | Should Be $true
|
|
||||||
$exception -like $Expected | Should Be $true
|
$exception | Should Match $Expected
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
it 'Check alternate syntax that also supports complex variable names' {
|
it 'Check alternate syntax that also supports complex variable names' {
|
||||||
|
|
||||||
& {
|
& {
|
||||||
$script:mydata = data { 123 }
|
$script:mydata = data { 123 }
|
||||||
}
|
}
|
||||||
$mydata | Should Be 123
|
$mydata | Should Be 123
|
||||||
|
|
||||||
$mydata = data { 456 }
|
$mydata = data { 456 }
|
||||||
|
|||||||
Reference in new issue
Block a user