diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-24 16:10:47 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-07-24 16:10:47 +0000 |
commit | fd939162ff99a0084ed22a08dd37c149a0883a2b (patch) | |
tree | 7158d0914e86a8b1bdaf6b853bb062dcc6a85fb5 /unittests/AST/CommentParser.cpp | |
parent | 9f17408d50c1d76c5eab435e4ceb924cc10757ab (diff) |
Comment parsing: retokenized text tokens are now pushed back in correct (not
reverse) order
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160675 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/AST/CommentParser.cpp')
-rw-r--r-- | unittests/AST/CommentParser.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/unittests/AST/CommentParser.cpp b/unittests/AST/CommentParser.cpp index 87e10cebc0..ed7681d5c5 100644 --- a/unittests/AST/CommentParser.cpp +++ b/unittests/AST/CommentParser.cpp @@ -755,6 +755,31 @@ TEST_F(CommentParserTest, ParamCommand4) { } } +TEST_F(CommentParserTest, ParamCommand5) { + const char *Source = + "// \\param aaa \\% Bbb \\$ ccc\n"; + + FullComment *FC = parseString(Source); + ASSERT_TRUE(HasChildCount(FC, 2)); + + ASSERT_TRUE(HasParagraphCommentAt(FC, 0, " ")); + { + ParamCommandComment *PCC; + ParagraphComment *PC; + ASSERT_TRUE(HasParamCommandAt(FC, 1, PCC, "param", + ParamCommandComment::In, + /* IsDirectionExplicit = */ false, + "aaa", PC)); + ASSERT_TRUE(HasChildCount(PCC, 1)); + + ASSERT_TRUE(HasChildCount(PC, 5)); + ASSERT_TRUE(HasTextAt(PC, 0, " ")); + ASSERT_TRUE(HasTextAt(PC, 1, "%")); + ASSERT_TRUE(HasTextAt(PC, 2, " Bbb ")); + ASSERT_TRUE(HasTextAt(PC, 3, "$")); + ASSERT_TRUE(HasTextAt(PC, 4, " ccc")); + } +} TEST_F(CommentParserTest, InlineCommand1) { const char *Source = "// \\c"; |