commit | 4af95e7eab87fc680c15d73d932dfda7389fc84b | [log] [tgz] |
---|---|---|
author | Brett Porter <brett@apache.org> | Fri Aug 22 08:49:27 2014 +0000 |
committer | Brett Porter <brett@apache.org> | Fri Aug 22 08:49:27 2014 +0000 |
tree | f96b7ef7efa2bc246ee65fe2265fdd2825ed70ac | |
parent | 3fdb9372ccd035e5cb121f3fd0522b1643f7e71c [diff] |
[NPANDAY-525] fix tests for bash git-svn-id: https://svn.apache.org/repos/asf/incubator/npanday/trunk@1619706 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy b/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy index 1024b18..0facb08 100644 --- a/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy +++ b/components/dotnet-executable/src/test/groovy/npanday/executable/execution/CommandExecutorTest.groovy
@@ -89,13 +89,16 @@ 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 @@ { 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