#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 {
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) { … }
#if !defined(V8_TARGET_OS_FUCHSIA)
int CountPreludeLines() { … }
#endif
SubstrWithPosition;
#if !defined(V8_TARGET_OS_FUCHSIA)
SubstrWithPosition SubstrTester(const std::string& message, int line, int col) { … }
#endif
using SubstrVector = std::vector<SubstrWithPosition>;
}
TEST(Torque, Prelude) { … }
TEST(Torque, StackDeleteRange) { … }
HasSubstr;
TEST(Torque, TypeNamingConventionLintError) { … }
TEST(Torque, StructNamingConventionLintError) { … }
TEST(Torque, ClassDefinition) { … }
TEST(Torque, TypeDeclarationOrder) { … }
#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) { … }
#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) { … }
#if !defined(V8_TARGET_OS_FUCHSIA)
TEST(Torque, ImportNonExistentFile) { … }
#endif
TEST(Torque, LetShouldBeConstLintError) { … }
TEST(Torque, LetShouldBeConstIsSkippedForStructs) { … }
#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) { … }
}
}
}