llvm/clang/unittests/Tooling/Syntax/TokensTest.cpp

//===- TokensTest.cpp -----------------------------------------------------===//
//
// 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 "clang/Tooling/Syntax/Tokens.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/Expr.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TokenKinds.def"
#include "clang/Basic/TokenKinds.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Lex/Token.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include <cassert>
#include <cstdlib>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <memory>
#include <optional>
#include <ostream>
#include <string>

usingnamespaceclang;
usingnamespaceclang::syntax;

ValueIs;
_;
AllOf;
Contains;
ElementsAre;
Field;
IsEmpty;
Matcher;
Not;
Pointee;
StartsWith;

namespace {
// Checks the passed ArrayRef<T> has the same begin() and end() iterators as the
// argument.
MATCHER_P(SameRange, A, "") {}

Matcher<TokenBuffer::Expansion>
IsExpansion(Matcher<llvm::ArrayRef<syntax::Token>> Spelled,
            Matcher<llvm::ArrayRef<syntax::Token>> Expanded) {}
// Matchers for syntax::Token.
MATCHER_P(Kind, K, "") {}
MATCHER_P2(HasText, Text, SourceMgr, "") {}
/// Checks the start and end location of a token are equal to SourceRng.
MATCHER_P(RangeIs, SourceRng, "") {}

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

TEST_F(TokenCollectorTest, RawMode) {}

TEST_F(TokenCollectorTest, Basic) {}

TEST_F(TokenCollectorTest, Locations) {}

TEST_F(TokenCollectorTest, LocationInMiddleOfSpelledToken) {}

TEST_F(TokenCollectorTest, MacroDirectives) {}

TEST_F(TokenCollectorTest, MacroReplacements) {}

TEST_F(TokenCollectorTest, SpecialTokens) {}

TEST_F(TokenCollectorTest, LateBoundTokens) {}

TEST_F(TokenCollectorTest, DelayedParsing) {}

TEST_F(TokenCollectorTest, MultiFile) {}

class TokenBufferTest : public TokenCollectorTest {};

TEST_F(TokenBufferTest, SpelledByExpanded) {}

TEST_F(TokenBufferTest, NoCrashForEofToken) {}

TEST_F(TokenBufferTest, ExpandedTokensForRange) {}

TEST_F(TokenBufferTest, ExpansionsOverlapping) {}

TEST_F(TokenBufferTest, TokensToFileRange) {}

TEST_F(TokenBufferTest, MacroExpansions) {}

TEST_F(TokenBufferTest, Touching) {}

TEST_F(TokenBufferTest, ExpandedBySpelled) {}

TEST_F(TokenCollectorTest, Pragmas) {}
} // namespace