mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
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
This commit is contained in:
1 parent
7816516c24
commit
7e8070276f
5 files changed
+20
-16
No files matched your search
@@ -4,27 +4,18 @@ Describe "Native Command Arguments" -tags "CI" {
|
||||
while ($powershellTestDir -notmatch 'test[\\/]powershell$') {
|
||||
$powershellTestDir = Split-Path $powershellTestDir
|
||||
}
|
||||
$echoArgsDir = Join-Path (Split-Path $powershellTestDir) EchoArgs
|
||||
|
||||
function Start-EchoArgs {
|
||||
Push-Location $echoArgsDir
|
||||
try {
|
||||
dotnet run $args
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
}
|
||||
$echoArgs = Join-Path (Split-Path $powershellTestDir) tools/EchoArgs/run/echoargs
|
||||
|
||||
It "Should handle quoted spaces correctly" {
|
||||
$a = 'a"b c"d'
|
||||
Start-EchoArgs $a 'a"b c"d' a"b c"d >$testPath
|
||||
& $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" {
|
||||
Start-EchoArgs 'a\"b c\"d' "a\`"b c\`"d" >$testPath
|
||||
& $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>'
|
||||
}
|
||||
|
||||
@@ -19,10 +19,6 @@ namespace Pscx.Applications
|
||||
{
|
||||
Console.WriteLine("Arg {0} is <{1}>", i, args[i]);
|
||||
}
|
||||
|
||||
/*Console.WriteLine("\nCommand line:");
|
||||
Console.WriteLine(Environment.CommandLine);*/
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
Reference in new issue
Block a user