void () { assertTokens("a\\ b", true, "a b"); assertTokens("a\\ b", false, "a\\", "b"); assertTokens("\"a\\ b\"", true, "a\\ b"); assertTokens("\"a\\ b\"", false, "a\\ b"); assertTokens("a\\ ", true, "a "); assertTokens("a\\ ", false, "a\\"); assertTokens("\\\"", "\""); assertTokens("\"\\\" a \\\"\"", "\" a \""); assertTokens("\\\"a b\\\"", "\"a", "b\""); assertTokens("\\\"a\\ b\\\"", true, "\"a b\""); assertTokens("\\\"a\\ b\\\"", false, "\"a\\", "b\""); // Check tail \" as Java does (most compatible way to go: doubling the tail backslash), see comment in // http://cr.openjdk.org/~uta/openjdk-webrevs/JDK-8016046/webrev.01/src/windows/classes/java/lang/ProcessImpl.java.frames.html // line L188/R199 assertTokens("\"-lib=c:\\My Lib\\\\\" \"-include=c:\\My Include\\\\\"", true, "-lib=c:\\My Lib\\\\", "-include=c:\\My Include\\\\"); }