Author: brett
Date: Fri Aug 22 08:49:27 2014
New Revision: 1619706
URL: http://svn.apache.org/r1619706
Log:
[NPANDAY-525] fix tests for bash
Modified:
incubator/npanday/trunk/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy
Modified:
incubator/npanday/trunk/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy
URL:
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy?rev=1619706&r1=1619705&r2=1619706&view=diff
==============================================================================
---
incubator/npanday/trunk/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy
(original)
+++
incubator/npanday/trunk/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy
Fri Aug 22 08:49:27 2014
@@ -89,13 +89,16 @@ public class CommandExecutorTest
public void testCommandArgWithSpaces()
throws ExecutionException
{
- testArgExpansion(["a b"], '"a b\"');
+ testArgExpansion(["a b"], stripQuotes('"a b\"'));
}
@Test
public void testCommandArgWithEmbeddedSingleQuotes_middle()
throws ExecutionException
{
+ // Not supported by *nix single quoting
+ if (!isWindows()) return;
+
testArgExpansion(["a ' b"], '"a \' b"');
}
@@ -417,4 +420,12 @@ public class CommandExecutorTest
{
return Os.isFamily(Os.FAMILY_WINDOWS);
}
+
+ private static String stripQuotes(String s) {
+ // On bash, surrounding quotes are not shown by echo
+ if (!isWindows()) {
+ s = s.substring( 1, s.length() - 1 );
+ }
+ return s;
+ }
}
\ No newline at end of file