Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion checker/internal/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ cc_test(
"//common:ast",
"//common:decl",
"//common:type",
"//common/ast:expr",
"//internal:testing",
"//internal:testing_descriptor_pool",
"@com_google_absl//absl/status",
Expand Down
58 changes: 23 additions & 35 deletions checker/internal/type_checker_builder_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "checker/type_checker.h"
#include "checker/validation_result.h"
#include "common/ast.h"
#include "common/ast/expr.h"
#include "common/decl.h"
#include "common/type.h"
#include "common/type_introspector.h"
Expand Down Expand Up @@ -71,52 +70,42 @@ TEST_P(ContextDeclsFieldsDefinedTest, ContextDeclsFieldsDefined) {
INSTANTIATE_TEST_SUITE_P(
TestAllTypes, ContextDeclsFieldsDefinedTest,
testing::Values(
ContextDeclsTestCase{"single_int64",
TypeSpec(ast_internal::PrimitiveType::kInt64)},
ContextDeclsTestCase{"single_uint32",
TypeSpec(ast_internal::PrimitiveType::kUint64)},
ContextDeclsTestCase{"single_double",
TypeSpec(ast_internal::PrimitiveType::kDouble)},
ContextDeclsTestCase{"single_string",
TypeSpec(ast_internal::PrimitiveType::kString)},
ContextDeclsTestCase{"single_any",
TypeSpec(ast_internal::WellKnownType::kAny)},
ContextDeclsTestCase{"single_int64", TypeSpec(PrimitiveType::kInt64)},
ContextDeclsTestCase{"single_uint32", TypeSpec(PrimitiveType::kUint64)},
ContextDeclsTestCase{"single_double", TypeSpec(PrimitiveType::kDouble)},
ContextDeclsTestCase{"single_string", TypeSpec(PrimitiveType::kString)},
ContextDeclsTestCase{"single_any", TypeSpec(WellKnownTypeSpec::kAny)},
ContextDeclsTestCase{"single_duration",
TypeSpec(ast_internal::WellKnownType::kDuration)},
ContextDeclsTestCase{"single_bool_wrapper",
TypeSpec(ast_internal::PrimitiveTypeWrapper(
ast_internal::PrimitiveType::kBool))},
TypeSpec(WellKnownTypeSpec::kDuration)},
ContextDeclsTestCase{
"single_bool_wrapper",
TypeSpec(PrimitiveTypeWrapper(PrimitiveType::kBool))},
ContextDeclsTestCase{
"list_value",
TypeSpec(ast_internal::ListType(
std::make_unique<TypeSpec>(ast_internal::DynamicType())))},
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(DynTypeSpec())))},
ContextDeclsTestCase{
"standalone_message",
TypeSpec(ast_internal::MessageType(
TypeSpec(MessageTypeSpec(
"cel.expr.conformance.proto3.TestAllTypes.NestedMessage"))},
ContextDeclsTestCase{"standalone_enum",
TypeSpec(ast_internal::PrimitiveType::kInt64)},
ContextDeclsTestCase{
"repeated_bytes",
TypeSpec(ast_internal::ListType(std::make_unique<TypeSpec>(
ast_internal::PrimitiveType::kBytes)))},
TypeSpec(PrimitiveType::kInt64)},
ContextDeclsTestCase{"repeated_bytes",
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(
PrimitiveType::kBytes)))},
ContextDeclsTestCase{
"repeated_nested_message",
TypeSpec(ast_internal::ListType(std::make_unique<
TypeSpec>(ast_internal::MessageType(
TypeSpec(ListTypeSpec(std::make_unique<TypeSpec>(MessageTypeSpec(
"cel.expr.conformance.proto3.TestAllTypes.NestedMessage"))))},
ContextDeclsTestCase{
"map_int32_timestamp",
TypeSpec(ast_internal::MapType(
std::make_unique<TypeSpec>(ast_internal::PrimitiveType::kInt64),
std::make_unique<TypeSpec>(
ast_internal::WellKnownType::kTimestamp)))},
TypeSpec(MapTypeSpec(
std::make_unique<TypeSpec>(PrimitiveType::kInt64),
std::make_unique<TypeSpec>(WellKnownTypeSpec::kTimestamp)))},
ContextDeclsTestCase{
"single_struct",
TypeSpec(ast_internal::MapType(
std::make_unique<TypeSpec>(
ast_internal::PrimitiveType::kString),
std::make_unique<TypeSpec>(ast_internal::DynamicType())))}));
TypeSpec(
MapTypeSpec(std::make_unique<TypeSpec>(PrimitiveType::kString),
std::make_unique<TypeSpec>(DynTypeSpec())))}));

TEST(ContextDeclsTest, ErrorOnDuplicateContextDeclaration) {
TypeCheckerBuilderImpl builder(internal::GetSharedTestingDescriptorPool(),
Expand Down Expand Up @@ -323,8 +312,7 @@ TEST(TypeCheckerBuilderImplTest, ReplaceVariable) {

const auto& checked_ast = *result.GetAst();

EXPECT_EQ(checked_ast.GetReturnType(),
TypeSpec(ast_internal::PrimitiveType::kString));
EXPECT_EQ(checked_ast.GetReturnType(), TypeSpec(PrimitiveType::kString));
}

} // namespace
Expand Down
10 changes: 0 additions & 10 deletions common/ast/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ cc_test(
],
)

cc_library(
name = "expr",
hdrs = [
"expr.h",
],
deps = [
":metadata",
],
)

cc_library(
name = "source_info_proto",
srcs = ["source_info_proto.cc"],
Expand Down
46 changes: 0 additions & 46 deletions common/ast/expr.h

This file was deleted.

1 change: 0 additions & 1 deletion parser/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ cc_library(
":source_factory",
"//common:ast",
"//common:constant",
"//common:expr",
"//common:expr_factory",
"//common:operators",
"//common:source",
Expand Down
1 change: 0 additions & 1 deletion parser/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include "common/ast/expr_proto.h"
#include "common/ast/source_info_proto.h"
#include "common/constant.h"
#include "common/expr.h"
#include "common/expr_factory.h"
#include "common/operators.h"
#include "common/source.h"
Expand Down