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

//===-- SourceCodeTests.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 "Annotations.h"
#include "Protocol.h"
#include "SourceCode.h"
#include "TestTU.h"
#include "support/Context.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Format/Format.h"
#include "llvm/Support/Error.h"
#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <optional>
#include <tuple>

namespace clang {
namespace clangd {
namespace {

Failed;
FailedWithMessage;
HasValue;

MATCHER_P2(Pos, Line, Col, "") {}

MATCHER_P(macroName, Name, "") {}

/// A helper to make tests easier to read.
Position position(int Line, int Character) {}

TEST(SourceCodeTests, lspLength) {}

TEST(SourceCodeTests, lspLengthBadUTF8) {}

// The = → 🡆 below are ASCII (1 byte), BMP (3 bytes), and astral (4 bytes).
const char File[] =;
struct Line {};
Line FileLines[] =;

TEST(SourceCodeTests, PositionToOffset) {}

TEST(SourceCodeTests, OffsetToPosition) {}

TEST(SourceCodeTests, SourceLocationInMainFile) {}

TEST(SourceCodeTests, isReservedName) {}

TEST(SourceCodeTests, CollectIdentifiers) {}

TEST(SourceCodeTests, CollectWords) {}

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

TEST_F(SpelledWordsTest, HeuristicBoundaries) {}

TEST_F(SpelledWordsTest, LikelyIdentifier) {}

TEST_F(SpelledWordsTest, Comment) {}

TEST_F(SpelledWordsTest, PartOfString) {}

TEST_F(SpelledWordsTest, DisabledSection) {}

TEST_F(SpelledWordsTest, Macros) {}

TEST(SourceCodeTests, VisibleNamespaces) {}

TEST(SourceCodeTests, GetMacros) {}

TEST(SourceCodeTests, WorksAtBeginOfFile) {}

TEST(SourceCodeTests, IsInsideMainFile) {}

// Test for functions toHalfOpenFileRange and getHalfOpenFileRange
TEST(SourceCodeTests, HalfOpenFileRange) {}

TEST(SourceCodeTests, HalfOpenFileRangePathologicalPreprocessor) {}

TEST(SourceCodeTests, IncludeHashLoc) {}

TEST(SourceCodeTests, GetEligiblePoints) {}

TEST(SourceCodeTests, IdentifierRanges) {}

TEST(SourceCodeTests, isHeaderFile) {}

TEST(SourceCodeTests, isKeywords) {}

TEST(SourceCodeTests, isSpelledInSource) {}

struct IncrementalTestStep {};

int rangeLength(llvm::StringRef Code, const Range &Rng) {}

/// Send the changes one by one to updateDraft, verify the intermediate results.
void stepByStep(llvm::ArrayRef<IncrementalTestStep> Steps) {}

TEST(ApplyEditsTest, Simple) {}

TEST(ApplyEditsTest, MultiLine) {}

TEST(ApplyEditsTest, WrongRangeLength) {}

// Test that we correct observed buggy edits from Neovim.
TEST(ApplyEditsTets, BuggyNeovimEdits) {}

TEST(ApplyEditsTest, EndBeforeStart) {}

TEST(ApplyEditsTest, StartCharOutOfRange) {}

TEST(ApplyEditsTest, EndCharOutOfRange) {}

TEST(ApplyEditsTest, StartLineOutOfRange) {}

TEST(ApplyEditsTest, EndLineOutOfRange) {}

TEST(FormatStyleForFile, LanguageGuessingHeuristic) {}

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