aboutsummaryrefslogtreecommitdiff
path: root/unittests/AST/CommentLexer.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-06-27 16:53:58 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-06-27 16:53:58 +0000
commit962668d2c192dd02f75b8ec3628a89964bfb738b (patch)
tree2f8df4bba8cada7495502f1d329762247b05cc07 /unittests/AST/CommentLexer.cpp
parentf5e0aeac8a510ba1fd4c83391978cffd31e5ac69 (diff)
Remove unsigned and a pointer from a comment token (so that each token can have only one semantic string value attached to it), at a cost of adding an additional token.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/AST/CommentLexer.cpp')
-rw-r--r--unittests/AST/CommentLexer.cpp61
1 files changed, 32 insertions, 29 deletions
diff --git a/unittests/AST/CommentLexer.cpp b/unittests/AST/CommentLexer.cpp
index b73d16ca00..a1e2427880 100644
--- a/unittests/AST/CommentLexer.cpp
+++ b/unittests/AST/CommentLexer.cpp
@@ -588,15 +588,14 @@ TEST_F(CommentLexerTest, VerbatimLine1) {
ASSERT_EQ(4U, Toks.size());
- ASSERT_EQ(tok::text, Toks[0].getKind());
- ASSERT_EQ(StringRef(" "), Toks[0].getText());
+ ASSERT_EQ(tok::text, Toks[0].getKind());
+ ASSERT_EQ(StringRef(" "), Toks[0].getText());
- ASSERT_EQ(tok::verbatim_line, Toks[1].getKind());
- ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
- ASSERT_EQ(StringRef(""), Toks[1].getVerbatimLineText());
+ ASSERT_EQ(tok::verbatim_line_name, Toks[1].getKind());
+ ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
- ASSERT_EQ(tok::newline, Toks[2].getKind());
- ASSERT_EQ(tok::newline, Toks[3].getKind());
+ ASSERT_EQ(tok::newline, Toks[2].getKind());
+ ASSERT_EQ(tok::newline, Toks[3].getKind());
}
}
@@ -612,18 +611,20 @@ TEST_F(CommentLexerTest, VerbatimLine2) {
lexString(Sources[i], Toks);
- ASSERT_EQ(4U, Toks.size());
+ ASSERT_EQ(5U, Toks.size());
- ASSERT_EQ(tok::text, Toks[0].getKind());
- ASSERT_EQ(StringRef(" "), Toks[0].getText());
+ ASSERT_EQ(tok::text, Toks[0].getKind());
+ ASSERT_EQ(StringRef(" "), Toks[0].getText());
+
+ ASSERT_EQ(tok::verbatim_line_name, Toks[1].getKind());
+ ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
- ASSERT_EQ(tok::verbatim_line, Toks[1].getKind());
- ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
+ ASSERT_EQ(tok::verbatim_line_text, Toks[2].getKind());
ASSERT_EQ(StringRef(" void *foo(const char *zzz = \"\\$\");"),
- Toks[1].getVerbatimLineText());
+ Toks[2].getVerbatimLineText());
- ASSERT_EQ(tok::newline, Toks[2].getKind());
- ASSERT_EQ(tok::newline, Toks[3].getKind());
+ ASSERT_EQ(tok::newline, Toks[3].getKind());
+ ASSERT_EQ(tok::newline, Toks[4].getKind());
}
}
@@ -638,26 +639,28 @@ TEST_F(CommentLexerTest, VerbatimLine3) {
lexString(Source, Toks);
- ASSERT_EQ(8U, Toks.size());
+ ASSERT_EQ(9U, Toks.size());
- ASSERT_EQ(tok::text, Toks[0].getKind());
- ASSERT_EQ(StringRef(" "), Toks[0].getText());
+ ASSERT_EQ(tok::text, Toks[0].getKind());
+ ASSERT_EQ(StringRef(" "), Toks[0].getText());
+
+ ASSERT_EQ(tok::verbatim_line_name, Toks[1].getKind());
+ ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
- ASSERT_EQ(tok::verbatim_line, Toks[1].getKind());
- ASSERT_EQ(StringRef("fn"), Toks[1].getVerbatimLineName());
+ ASSERT_EQ(tok::verbatim_line_text, Toks[2].getKind());
ASSERT_EQ(StringRef(" void *foo(const char *zzz = \"\\$\");"),
- Toks[1].getVerbatimLineText());
- ASSERT_EQ(tok::newline, Toks[2].getKind());
+ Toks[2].getVerbatimLineText());
+ ASSERT_EQ(tok::newline, Toks[3].getKind());
- ASSERT_EQ(tok::text, Toks[3].getKind());
- ASSERT_EQ(StringRef(" Meow"), Toks[3].getText());
- ASSERT_EQ(tok::newline, Toks[4].getKind());
+ ASSERT_EQ(tok::text, Toks[4].getKind());
+ ASSERT_EQ(StringRef(" Meow"), Toks[4].getText());
+ ASSERT_EQ(tok::newline, Toks[5].getKind());
- ASSERT_EQ(tok::text, Toks[5].getKind());
- ASSERT_EQ(StringRef(" "), Toks[5].getText());
+ ASSERT_EQ(tok::text, Toks[6].getKind());
+ ASSERT_EQ(StringRef(" "), Toks[6].getText());
- ASSERT_EQ(tok::newline, Toks[6].getKind());
- ASSERT_EQ(tok::newline, Toks[7].getKind());
+ ASSERT_EQ(tok::newline, Toks[7].getKind());
+ ASSERT_EQ(tok::newline, Toks[8].getKind());
}
TEST_F(CommentLexerTest, HTML1) {