mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
* Rename Publish-EchoArgs to Publish-PSTestTools so it can be used for other tools as well in the future * Publish EchoArgs to the bin directory instead of run to match convention * Add source URL to EchoArgs header comment * Use wildcard of "*.nuget.props" to match "test/csharp/csharp.nuget.props" in .gitignore
23 lines
869 B
PowerShell
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/bin/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>'
|
|
}
|
|
}
|