diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-03-02 06:00:16 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-03-02 06:00:16 +0000 |
commit | b88d9480e04039188c39e49367cb13d64e644cf8 (patch) | |
tree | caffa443f1b8370b5bd89f41015958c91638f274 /unittests/Tooling/CompilationDatabaseTest.cpp | |
parent | cc5dbdae70c6eb2423921f52a35ba4686d2969cf (diff) |
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.cpp | 6 |
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"); |