commit | b88d9480e04039188c39e49367cb13d64e644cf8 | [log] [tgz] |
---|---|---|
author | Peter Collingbourne <peter@pcc.me.uk> | Sat Mar 02 06:00:16 2013 +0000 |
committer | Peter Collingbourne <peter@pcc.me.uk> | Sat Mar 02 06:00:16 2013 +0000 |
tree | caffa443f1b8370b5bd89f41015958c91638f274 | |
parent | cc5dbdae70c6eb2423921f52a35ba4686d2969cf [diff] [blame] |
CommandLineArgumentParser: handle single quotes. Differential Revision: http://llvm-reviews.chandlerc.com/D482 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176404 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Tooling/CompilationDatabaseTest.cpp b/unittests/Tooling/CompilationDatabaseTest.cpp index 5a35875..c453b05 100644 --- a/unittests/Tooling/CompilationDatabaseTest.cpp +++ b/unittests/Tooling/CompilationDatabaseTest.cpp
@@ -391,6 +391,12 @@ EXPECT_EQ("", Empty[0]); } +TEST(unescapeJsonCommandLine, ParsesSingleQuotedString) { + std::vector<std::string> Args = unescapeJsonCommandLine("a'\\\\b \\\"c\\\"'"); + ASSERT_EQ(1ul, Args.size()); + EXPECT_EQ("a\\b \"c\"", Args[0]); +} + TEST(FixedCompilationDatabase, ReturnsFixedCommandLine) { std::vector<std::string> CommandLine; CommandLine.push_back("one");