Uploaded image for project: 'Commons Exec'
  1. Commons Exec
  2. EXEC-82

Losing Single Quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2
    • None
    • None
    • OSX JDK 1.7

    Description

      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] }

      Attachments

        1. single_quote_tests.diff
          1 kB
          Kevin Brown

        Activity

          People

            Unassigned Unassigned
            kbrowncnn Kevin Brown
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: