diff options
| author | Dmitri Gribenko <gribozavr@gmail.com> | 2013-08-23 18:03:40 +0000 |
|---|---|---|
| committer | Dmitri Gribenko <gribozavr@gmail.com> | 2013-08-23 18:03:40 +0000 |
| commit | 1e50cbf366e9a8c0660189c34273bab22fe8b4ee (patch) | |
| tree | 3b2aeec18fd2e0f06c817e007eb4104340ce3e95 /clang/unittests/AST/CommentParser.cpp | |
| parent | fe06e811a36b5f612eda5f2459e3b4aae4505943 (diff) | |
| download | bcm5719-llvm-1e50cbf366e9a8c0660189c34273bab22fe8b4ee.tar.gz bcm5719-llvm-1e50cbf366e9a8c0660189c34273bab22fe8b4ee.zip | |
Comment parsing: fix a bug where a line with whitespace between two paragraphs
would cause us to concatenate these paragraphs into a single one.
The no-op whitespace churn in test/Index test happened because these tests
don't use the correct approach for testing and are more strict than required
for they are testing.
llvm-svn: 189126
Diffstat (limited to 'clang/unittests/AST/CommentParser.cpp')
| -rw-r--r-- | clang/unittests/AST/CommentParser.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/clang/unittests/AST/CommentParser.cpp b/clang/unittests/AST/CommentParser.cpp index d05fb58fafa..f75c636e01d 100644 --- a/clang/unittests/AST/CommentParser.cpp +++ b/clang/unittests/AST/CommentParser.cpp @@ -628,18 +628,43 @@ TEST_F(CommentParserTest, Basic3) { } } -TEST_F(CommentParserTest, Paragraph1) { +TEST_F(CommentParserTest, ParagraphSplitting1) { const char *Sources[] = { "// Aaa\n" "//\n" "// Bbb", "// Aaa\n" + "// \n" + "// Bbb", + + "// Aaa\n" + "//\t\n" + "// Bbb", + + "// Aaa\n" "//\n" "//\n" "// Bbb", - }; + "/**\n" + " Aaa\n" + "\n" + " Bbb\n" + "*/", + + "/**\n" + " Aaa\n" + " \n" + " Bbb\n" + "*/", + + "/**\n" + " Aaa\n" + "\t \n" + " Bbb\n" + "*/", + }; for (size_t i = 0, e = array_lengthof(Sources); i != e; i++) { FullComment *FC = parseString(Sources[i]); @@ -650,7 +675,7 @@ TEST_F(CommentParserTest, Paragraph1) { } } -TEST_F(CommentParserTest, Paragraph2) { +TEST_F(CommentParserTest, Paragraph1) { const char *Source = "// \\brief Aaa\n" "//\n" @@ -670,7 +695,7 @@ TEST_F(CommentParserTest, Paragraph2) { ASSERT_TRUE(HasParagraphCommentAt(FC, 2, " Bbb")); } -TEST_F(CommentParserTest, Paragraph3) { +TEST_F(CommentParserTest, Paragraph2) { const char *Source = "// \\brief \\author"; FullComment *FC = parseString(Source); @@ -694,7 +719,7 @@ TEST_F(CommentParserTest, Paragraph3) { } } -TEST_F(CommentParserTest, Paragraph4) { +TEST_F(CommentParserTest, Paragraph3) { const char *Source = "// \\brief Aaa\n" "// Bbb \\author\n" |

