From 11e279d688c413b13e28bf2645802f5372c4d362 Mon Sep 17 00:00:00 2001 From: Yanbing Wang Date: Fri, 2 Sep 2016 11:07:18 -0700 Subject: [PATCH] Update based on PR feedback --- .../Language/Scripting/I18n.Tests.ps1 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/powershell/Language/Scripting/I18n.Tests.ps1 b/test/powershell/Language/Scripting/I18n.Tests.ps1 index a69f8eb1c..09b67b6db 100644 --- a/test/powershell/Language/Scripting/I18n.Tests.ps1 +++ b/test/powershell/Language/Scripting/I18n.Tests.ps1 @@ -130,9 +130,9 @@ Describe 'Testing of script internationalization' -Tags "CI" { } $testData = @( - @{cmd = 'data d { @{ x=$(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 { @{ x=$(get-command)} }';Expected='get-command'}, + @{cmd = 'data d { if ($(get-command)) {} }';Expected='get-command'}, + @{cmd = 'data d { @(get-command) }';Expected='get-command'} ) It 'Allowed cmdlets checked properly' -TestCase:$testData { @@ -141,18 +141,18 @@ Describe 'Testing of script internationalization' -Tags "CI" { $script:exception = $null & { trap {$script:exception = $_.Exception ; continue } - iex $cmd - } - #$exception -like '*get-command*' | Should Be $true - $exception -like $Expected | Should Be $true + invoke-expression $cmd + } + + $exception | Should Match $Expected } it 'Check alternate syntax that also supports complex variable names' { & { - $script:mydata = data { 123 } - } + $script:mydata = data { 123 } + } $mydata | Should Be 123 $mydata = data { 456 }