aboutsummaryrefslogtreecommitdiff
path: root/unittests/AST/CommentLexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/AST/CommentLexer.cpp')
-rw-r--r--unittests/AST/CommentLexer.cpp34
1 files changed, 31 insertions, 3 deletions
diff --git a/unittests/AST/CommentLexer.cpp b/unittests/AST/CommentLexer.cpp
index 2ec741ba3d..cc4535a163 100644
--- a/unittests/AST/CommentLexer.cpp
+++ b/unittests/AST/CommentLexer.cpp
@@ -322,7 +322,35 @@ TEST_F(CommentLexerTest, DoxygenCommand4) {
}
}
+// A command marker followed by a non-letter that is not a part of an escape
+// sequence.
TEST_F(CommentLexerTest, DoxygenCommand5) {
+ const char *Source = "/// \\^ \\0";
+ std::vector<Token> Toks;
+
+ lexString(Source, Toks);
+
+ ASSERT_EQ(6U, Toks.size());
+
+ ASSERT_EQ(tok::text, Toks[0].getKind());
+ ASSERT_EQ(StringRef(" "), Toks[0].getText());
+
+ ASSERT_EQ(tok::text, Toks[1].getKind());
+ ASSERT_EQ(StringRef("\\"), Toks[1].getText());
+
+ ASSERT_EQ(tok::text, Toks[2].getKind());
+ ASSERT_EQ(StringRef("^ "), Toks[2].getText());
+
+ ASSERT_EQ(tok::text, Toks[3].getKind());
+ ASSERT_EQ(StringRef("\\"), Toks[3].getText());
+
+ ASSERT_EQ(tok::text, Toks[4].getKind());
+ ASSERT_EQ(StringRef("0"), Toks[4].getText());
+
+ ASSERT_EQ(tok::newline, Toks[5].getKind());
+}
+
+TEST_F(CommentLexerTest, DoxygenCommand6) {
const char *Source = "/// \\brief Aaa.";
std::vector<Token> Toks;
@@ -342,7 +370,7 @@ TEST_F(CommentLexerTest, DoxygenCommand5) {
ASSERT_EQ(tok::newline, Toks[3].getKind());
}
-TEST_F(CommentLexerTest, DoxygenCommand6) {
+TEST_F(CommentLexerTest, DoxygenCommand7) {
const char *Source = "/// \\em\\em \\em\t\\em\n";
std::vector<Token> Toks;
@@ -374,7 +402,7 @@ TEST_F(CommentLexerTest, DoxygenCommand6) {
ASSERT_EQ(tok::newline, Toks[7].getKind());
}
-TEST_F(CommentLexerTest, DoxygenCommand7) {
+TEST_F(CommentLexerTest, DoxygenCommand8) {
const char *Source = "/// \\aaa\\bbb \\ccc\t\\ddd\n";
std::vector<Token> Toks;
@@ -406,7 +434,7 @@ TEST_F(CommentLexerTest, DoxygenCommand7) {
ASSERT_EQ(tok::newline, Toks[7].getKind());
}
-TEST_F(CommentLexerTest, DoxygenCommand8) {
+TEST_F(CommentLexerTest, DoxygenCommand9) {
const char *Source = "// \\c\n";
std::vector<Token> Toks;