commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Brown (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (EXEC-82) Losing Single Quotes
Date Wed, 19 Feb 2014 17:30:22 GMT

     [ https://issues.apache.org/jira/browse/EXEC-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kevin Brown updated EXEC-82:
----------------------------

    Attachment: single_quote_tests.diff

Patch file, as requested

> Losing Single Quotes 
> ---------------------
>
>                 Key: EXEC-82
>                 URL: https://issues.apache.org/jira/browse/EXEC-82
>             Project: Commons Exec
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: OSX JDK 1.7
>            Reporter: Kevin Brown
>         Attachments: single_quote_tests.diff
>
>
> if I have a single quote at the end of my argument it disappears.  Sometimes one at the
beginning disappears as well.  These test cases are not intended to be comprehensive.
>  @Test
>     public void testCommandLineQuoting1() {
>         CommandLine cmdLine = new CommandLine("foo.sh");
>         cmdLine.addArgument("12'3'4");
>         assertEquals("[foo.sh, \"12'3'4\"]", cmdLine.toString()); //OK
>     }
> 	@Test
>     public void testCommandLineQuoting2() {
>         CommandLine cmdLine = new CommandLine("foo.sh");
>         cmdLine.addArgument("12'3'");
>         assertEquals("[foo.sh, \"12'3'\"]", cmdLine.toString());
> //Expected :[foo.sh, "12'3'"]
> //Actual   :[foo.sh, "12'3"]
> 	}
>     @Test
>     public void testCommandLineQuoting3() {
>         CommandLine cmdLine = new CommandLine("foo.sh");
>         cmdLine.addArgument("'123'");
>         assertEquals("[foo.sh, \"'123'\"]", cmdLine.toString());
> //Expected :[foo.sh, "'123'"]
> //Actual   :[foo.sh, 123]
>      }



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message