chromium/v8/test/unittests/torque/torque-unittest.cc

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <optional>

#include "src/torque/torque-compiler.h"
#include "src/torque/utils.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock-support.h"

namespace v8 {
namespace internal {
namespace torque {

namespace {

// This is a simplified version of the basic Torque type definitions.
// Some class types are replaced by abstact types to keep it self-contained and
// small.
constexpr const char* kTestTorquePrelude =;

TorqueCompilerResult TestCompileTorque(std::string source) {}

void ExpectSuccessfulCompilation(std::string source) {}

template <class T>
using MatcherVector =
    std::vector<std::pair<::testing::PolymorphicMatcher<T>, LineAndColumn>>;

template <class T>
void ExpectFailingCompilation(std::string source,
                              MatcherVector<T> message_patterns) {}

template <class T>
void ExpectFailingCompilation(
    std::string source, ::testing::PolymorphicMatcher<T> message_pattern) {}

// TODO(almuthanna): the definition of this function is skipped on Fuchsia
// because it causes an 'unused function' exception upon buidling gn
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
int CountPreludeLines() {}
#endif

SubstrWithPosition;

// TODO(almuthanna): the definition of this function is skipped on Fuchsia
// because it causes an 'unused function' exception upon buidling gn
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
SubstrWithPosition SubstrTester(const std::string& message, int line, int col) {}
#endif

using SubstrVector = std::vector<SubstrWithPosition>;

}  // namespace

TEST(Torque, Prelude) {}

TEST(Torque, StackDeleteRange) {}

HasSubstr;
TEST(Torque, TypeNamingConventionLintError) {}

TEST(Torque, StructNamingConventionLintError) {}

TEST(Torque, ClassDefinition) {}

TEST(Torque, TypeDeclarationOrder) {}

// TODO(almuthanna): These tests were skipped because they cause a crash when
// they are ran on Fuchsia. This issue should be solved later on
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
TEST(Torque, ConditionalFields) {}

TEST(Torque, ConstexprLetBindingDoesNotCrash) {}

TEST(Torque, FailedImplicitCastFromConstexprDoesNotCrash) {}

TEST(Torque, DoubleUnderScorePrefixIllegalForIdentifiers) {}
#endif

TEST(Torque, UnusedLetBindingLintError) {}

TEST(Torque, UnderscorePrefixSilencesUnusedWarning) {}

// TODO(almuthanna): This test was skipped because it causes a crash when it is
// ran on Fuchsia. This issue should be solved later on
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
TEST(Torque, UsingUnderscorePrefixedIdentifierError) {}
#endif

TEST(Torque, UnusedArgumentLintError) {}

TEST(Torque, UsingUnderscorePrefixedArgumentSilencesWarning) {}

TEST(Torque, UnusedLabelLintError) {}

TEST(Torque, UsingUnderScorePrefixLabelSilencesWarning) {}

TEST(Torque, NoUnusedWarningForImplicitArguments) {}

TEST(Torque, NoUnusedWarningForVariablesOnlyUsedInDchecks) {}

// TODO(almuthanna): This test was skipped because it causes a crash when it is
// ran on Fuchsia. This issue should be solved later on
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
TEST(Torque, ImportNonExistentFile) {}
#endif

TEST(Torque, LetShouldBeConstLintError) {}

TEST(Torque, LetShouldBeConstIsSkippedForStructs) {}

// TODO(almuthanna): These tests were skipped because they cause a crash when
// they are ran on Fuchsia. This issue should be solved later on
// Ticket: https://crbug.com/1028617
#if !defined(V8_TARGET_OS_FUCHSIA)
TEST(Torque, GenericAbstractType) {}

TEST(Torque, SpecializationRequesters) {}
#endif

TEST(Torque, Enums) {}

TEST(Torque, EnumInTypeswitch) {}

TEST(Torque, EnumTypeAnnotations) {}

TEST(Torque, ConstClassFields) {}

TEST(Torque, References) {}

TEST(Torque, CatchFirstHandler) {}

TEST(Torque, BitFieldLogicalAnd) {}

TEST(Torque, FieldAccessOnNonClassType) {}

TEST(Torque, UnusedImplicit) {}

TEST(Torque, ImplicitTemplateParameterInference) {}

TEST(Torque, BuiltinReturnsNever) {}

}  // namespace torque
}  // namespace internal
}  // namespace v8