summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp b/clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp
index 76489aada14..c1d67a1751b 100644
--- a/clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp
+++ b/clang-tools-extra/unittests/clang-query/QueryEngineTest.cpp
@@ -111,6 +111,19 @@ TEST_F(QueryEngineTest, Basic) {
Str.clear();
+ EXPECT_TRUE(EnableOutputQuery(&QuerySession::DiagOutput).run(OS, S));
+ EXPECT_TRUE(EnableOutputQuery(&QuerySession::DetailedASTOutput).run(OS, S));
+ EXPECT_TRUE(MatchQuery(FooMatcherString, FooMatcher).run(OS, S));
+
+ {
+ auto Output = OS.str();
+ EXPECT_TRUE(Output.find("FunctionDecl") != std::string::npos);
+ EXPECT_TRUE(Output.find("foo.cc:1:1: note: \"root\" binds here") !=
+ std::string::npos);
+ }
+
+ Str.clear();
+
EXPECT_TRUE(SetQuery<bool>(&QuerySession::BindRoot, false).run(OS, S));
EXPECT_TRUE(MatchQuery(FooMatcherString, FooMatcher).run(OS, S));
OpenPOWER on IntegriCloud