llvm/clang-tools-extra/clangd/unittests/FindTargetTests.cpp

//===-- FindTargetTests.cpp --------------------------*- C++ -*------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "FindTarget.h"

#include "Selection.h"
#include "TestTU.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <initializer_list>

namespace clang {
namespace clangd {
namespace {

// A referenced Decl together with its DeclRelationSet, for assertions.
//
// There's no great way to assert on the "content" of a Decl in the general case
// that's both expressive and unambiguous (e.g. clearly distinguishes between
// templated decls and their specializations).
//
// We use the result of pretty-printing the decl, with the {body} truncated.
struct PrintedDecl {};
bool operator==(const PrintedDecl &L, const PrintedDecl &R) {}
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const PrintedDecl &D) {}

// The test cases in for targetDecl() take the form
//  - a piece of code (Code = "...")
//  - Code should have a single AST node marked as a [[range]]
//  - an EXPECT_DECLS() assertion that verify the type of node selected, and
//    all the decls that targetDecl() considers it to reference
// Despite the name, these cases actually test allTargetDecls() for brevity.
class TargetDeclTest : public ::testing::Test {};

// This is a macro to preserve line numbers in assertion failures.
// It takes the expected decls as varargs to work around comma-in-macro issues.
#define EXPECT_DECLS(NodeType, ...)
ExpectedDecls;

TEST_F(TargetDeclTest, Exprs) {}

TEST_F(TargetDeclTest, RecoveryForC) {}

TEST_F(TargetDeclTest, Recovery) {}

TEST_F(TargetDeclTest, RecoveryType) {}

TEST_F(TargetDeclTest, UsingDecl) {}

TEST_F(TargetDeclTest, BaseSpecifier) {}

TEST_F(TargetDeclTest, ConstructorInitList) {}

TEST_F(TargetDeclTest, DesignatedInit) {}

TEST_F(TargetDeclTest, NestedNameSpecifier) {}

TEST_F(TargetDeclTest, Types) {}

TEST_F(TargetDeclTest, ClassTemplate) {}

TEST_F(TargetDeclTest, Concept) {}

TEST_F(TargetDeclTest, Coroutine) {}

TEST_F(TargetDeclTest, RewrittenBinaryOperator) {}

TEST_F(TargetDeclTest, FunctionTemplate) {}

TEST_F(TargetDeclTest, VariableTemplate) {}

TEST_F(TargetDeclTest, TypeAliasTemplate) {}

TEST_F(TargetDeclTest, BuiltinTemplates) {}

TEST_F(TargetDeclTest, MemberOfTemplate) {}

TEST_F(TargetDeclTest, Lambda) {}

TEST_F(TargetDeclTest, OverloadExpr) {}

TEST_F(TargetDeclTest, DependentExprs) {}

TEST_F(TargetDeclTest, DependentTypes) {}

TEST_F(TargetDeclTest, TypedefCascade) {}

TEST_F(TargetDeclTest, RecursiveTemplate) {}

TEST_F(TargetDeclTest, ObjC) {}

class FindExplicitReferencesTest : public ::testing::Test {};

TEST_F(FindExplicitReferencesTest, AllRefsInFoo) {}

TEST_F(FindExplicitReferencesTest, AllRefs) {}

} // namespace
} // namespace clangd
} // namespace clang