1 //===-- ShowSelectionTreeTests.cpp ------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "TweakTesting.h"
10 #include "gmock/gmock-matchers.h"
11 #include "gmock/gmock.h"
12 #include "gtest/gtest.h"
18 TWEAK_TEST(ShowSelectionTree
);
20 TEST_F(ShowSelectionTreeTest
, Test
) {
21 EXPECT_AVAILABLE("^int f^oo() { re^turn 2 ^+ 2; }");
22 EXPECT_AVAILABLE("/*c^omment*/ int foo() { return 2 ^ + 2; }");
24 const char *Output
= R
"(message:
26 VarDecl int x = fcall(2 + 2)
27 .CallExpr fcall(2 + 2)
28 ImplicitCastExpr fcall
33 EXPECT_EQ(apply("int fcall(int); int x = fca[[ll(2 +]]2);"), Output
);
42 EXPECT_EQ(apply("void x() { for (;;) br^eak; }"), Output
);