aboutsummaryrefslogtreecommitdiff
path: root/unittests/Lex/LexerTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Lex/LexerTest.cpp')
-rw-r--r--unittests/Lex/LexerTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Lex/LexerTest.cpp b/unittests/Lex/LexerTest.cpp
index 05478eef9f..fecdb7fc05 100644
--- a/unittests/Lex/LexerTest.cpp
+++ b/unittests/Lex/LexerTest.cpp
@@ -114,6 +114,11 @@ TEST_F(LexerTest, LexAPI) {
EXPECT_EQ(range.getAsRange(),
SourceRange(macroRange.getBegin(),
macroRange.getEnd().getLocWithOffset(1)));
+
+ StringRef text = Lexer::getSourceText(
+ CharSourceRange::getTokenRange(SourceRange(lsqrLoc, rsqrLoc)),
+ SourceMgr, LangOpts);
+ EXPECT_EQ(text, "M(foo)");
}
} // anonymous namespace