summaryrefslogtreecommitdiffstats
path: root/clang/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
commitfe7a3486149938e043e615926de40516ab05ff60 (patch)
treeb893f5663f1ab340635f856a3a640ace22941f08 /clang/unittests/Tooling/CompilationDatabaseTest.cpp
parent20ef54f4c1d883773d1aa6e638a0603f6718ccb9 (diff)
downloadbcm5719-llvm-fe7a3486149938e043e615926de40516ab05ff60.tar.gz
bcm5719-llvm-fe7a3486149938e043e615926de40516ab05ff60.zip
CommandLineArgumentParser: handle single quotes.
Differential Revision: http://llvm-reviews.chandlerc.com/D482 llvm-svn: 176404
Diffstat (limited to 'clang/unittests/Tooling/CompilationDatabaseTest.cpp')
-rw-r--r--clang/unittests/Tooling/CompilationDatabaseTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Tooling/CompilationDatabaseTest.cpp b/clang/unittests/Tooling/CompilationDatabaseTest.cpp
index 5a35875c3e5..c453b056d25 100644
--- a/clang/unittests/Tooling/CompilationDatabaseTest.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud