Files
PowerShell/test/powershell/Scripting/NativeExecution/NativeCommandArguments.Tests.ps1
T
Douglas Thrift 7e8070276f Move and "publish" EchoArgs for the tests
* Move EchoArgs from test/EchoArgs to test/tools/EchoArgs
* Use "dotnet publish" for building EchoArgs in build.psm1 so the test
  can call it directly
2016-09-13 13:37:42 -07:00

23 lines
869 B
PowerShell

Describe "Native Command Arguments" -tags "CI" {
$testPath = 'TestDrive:\test.txt'
$powershellTestDir = $PSScriptRoot
while ($powershellTestDir -notmatch 'test[\\/]powershell$') {
$powershellTestDir = Split-Path $powershellTestDir
}
$echoArgs = Join-Path (Split-Path $powershellTestDir) tools/EchoArgs/run/echoargs
It "Should handle quoted spaces correctly" {
$a = 'a"b c"d'
& $echoArgs $a 'a"b c"d' a"b c"d >$testPath
$testPath | Should Contain 'Arg 0 is <ab cd>'
$testPath | Should Contain 'Arg 1 is <ab cd>'
$testPath | Should Contain 'Arg 2 is <ab cd>'
}
It "Should handle spaces between escaped quotes" {
& $echoArgs 'a\"b c\"d' "a\`"b c\`"d" >$testPath
$testPath | Should Contain 'Arg 0 is <a"b c"d>'
$testPath | Should Contain 'Arg 1 is <a"b c"d>'
}
}