summaryrefslogtreecommitdiff
path: root/unittests/Tooling/CompilationDatabaseTest.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2013-03-02 06:00:16 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2013-03-02 06:00:16 +0000
commitb88d9480e04039188c39e49367cb13d64e644cf8 (patch)
treecaffa443f1b8370b5bd89f41015958c91638f274 /unittests/Tooling/CompilationDatabaseTest.cpp
parentcc5dbdae70c6eb2423921f52a35ba4686d2969cf (diff)
downloadclang-b88d9480e04039188c39e49367cb13d64e644cf8.tar.gz
clang-b88d9480e04039188c39e49367cb13d64e644cf8.tar.bz2
clang-b88d9480e04039188c39e49367cb13d64e644cf8.tar.xz
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
Diffstat (limited to 'unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r--unittests/Tooling/CompilationDatabaseTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Tooling/CompilationDatabaseTest.cpp b/unittests/Tooling/CompilationDatabaseTest.cpp
index 5a35875c3e..c453b056d2 100644
--- a/unittests/Tooling/CompilationDatabaseTest.cpp
+++ b/unittests/Tooling/CompilationDatabaseTest.cpp
@@ -391,6 +391,12 @@ TEST(unescapeJsonCommandLine, ParsesQuotedStringWithoutClosingQuote) {
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");