#include "clang/Tooling/Transformer/SourceCode.h"
#include "TestVisitor.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
usingnamespaceclang;
usingnamespaceclang::ast_matchers;
Failed;
Succeeded;
ValueIs;
Optional;
getAssociatedRange;
getExtendedRange;
getExtendedText;
getFileRangeForEdit;
getText;
maybeExtendRange;
validateEditRange;
namespace {
struct IntLitVisitor : TestVisitor<IntLitVisitor> { … };
struct CallsVisitor : TestVisitor<CallsVisitor> { … };
struct TypeLocVisitor : TestVisitor<TypeLocVisitor> { … };
MATCHER_P(EqualsRange, R, "") { … }
MATCHER_P2(EqualsAnnotatedRange, Context, R, "") { … }
static ::testing::Matcher<CharSourceRange> AsRange(const SourceManager &SM,
llvm::Annotations::Range R) { … }
template <typename T> class AnnotatedCodeVisitor : public TestVisitor<T> { … };
TEST(SourceCodeTest, getText) { … }
TEST(SourceCodeTest, getTextWithMacro) { … }
TEST(SourceCodeTest, getExtendedText) { … }
TEST(SourceCodeTest, maybeExtendRange_TokenRange) { … }
TEST(SourceCodeTest, maybeExtendRange_CharRange) { … }
TEST(SourceCodeTest, getAssociatedRange) { … }
TEST(SourceCodeTest, getAssociatedRangeClasses) { … }
TEST(SourceCodeTest, getAssociatedRangeClassTemplateSpecializations) { … }
TEST(SourceCodeTest, getAssociatedRangeFunctions) { … }
TEST(SourceCodeTest, getAssociatedRangeMemberTemplates) { … }
TEST(SourceCodeTest, getAssociatedRangeWithComments) { … }
TEST(SourceCodeTest, getAssociatedRangeInvalidForPartialExpansions) { … }
class GetFileRangeForEditTest : public testing::TestWithParam<bool> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(GetFileRangeForEditTest, EditRangeWithMacroExpansionsShouldSucceed) { … }
TEST(SourceCodeTest, EditWholeMacroExpansionShouldSucceed) { … }
TEST(SourceCodeTest, EditInvolvingExpansionIgnoringExpansionShouldFail) { … }
TEST(SourceCodeTest, InnerNestedTemplate) { … }
TEST_P(GetFileRangeForEditTest, EditPartialMacroExpansionShouldFail) { … }
TEST_P(GetFileRangeForEditTest, EditWholeMacroArgShouldSucceed) { … }
TEST_P(GetFileRangeForEditTest, EditPartialMacroArgShouldSucceed) { … }
TEST(SourceCodeTest, EditRangeWithMacroExpansionsIsValid) { … }
TEST(SourceCodeTest, SpellingRangeOfMacroArgIsValid) { … }
TEST(SourceCodeTest, InvalidEditRangeIsInvalid) { … }
TEST(SourceCodeTest, InvertedEditRangeIsInvalid) { … }
TEST(SourceCodeTest, MacroArgIsInvalid) { … }
TEST(SourceCodeTest, EditWholeMacroExpansionIsInvalid) { … }
TEST(SourceCodeTest, EditPartialMacroExpansionIsInvalid) { … }
TEST(SourceCodeTest, GetCallReturnType_Dependent) { … }
}