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
30 changes: 10 additions & 20 deletions eval/public/structs/cel_proto_wrap_value_to_message_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,8 @@ TEST_F(CelProtoWrapValueToMessageTest, WrapStruct) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField1)),
CelValue::CreateBool(true)}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Value json;
Expand All @@ -431,10 +429,8 @@ TEST_F(CelProtoWrapValueToMessageTest, WrapStruct) {
TEST_F(CelProtoWrapValueToMessageTest, WrapFailureStructBadKeyType) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateInt64(1L), CelValue::CreateBool(true)}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Value json;
Expand All @@ -447,10 +443,8 @@ TEST_F(CelProtoWrapValueToMessageTest, WrapFailureStructBadValueType) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField1)),
MessageToCelValue(&bad_value)}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());
Value json;
ExpectNotWrapped(cel_value, json);
Expand Down Expand Up @@ -522,10 +516,8 @@ TEST_F(CelProtoWrapValueToMessageTest, WrapMapWithFieldMaskToAny) {

std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField)), value}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
CelValue cel_value = CelValue::CreateMap(cel_map.get());

Struct expected_struct;
Expand Down Expand Up @@ -581,10 +573,8 @@ TEST_F(CelProtoWrapValueToMessageTest, WrapMapWithEmptyToAny) {

std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField)), value}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Struct expected_struct;
Expand Down
24 changes: 8 additions & 16 deletions eval/public/structs/cel_proto_wrapper_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,8 @@ TEST_F(CelProtoWrapperTest, WrapStruct) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField1)),
CelValue::CreateBool(true)}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Value json;
Expand Down Expand Up @@ -861,10 +859,8 @@ TEST_F(CelProtoWrapperTest, WrapMapWithEmptyToAny) {

std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField)), value}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Struct expected_struct;
Expand Down Expand Up @@ -894,10 +890,8 @@ TEST_F(CelProtoWrapperTest, WrapListWithEmptyToAny) {
TEST_F(CelProtoWrapperTest, WrapFailureStructBadKeyType) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateInt64(1L), CelValue::CreateBool(true)}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());

Value json;
Expand All @@ -910,10 +904,8 @@ TEST_F(CelProtoWrapperTest, WrapFailureStructBadValueType) {
std::vector<std::pair<CelValue, CelValue>> args = {
{CelValue::CreateString(CelValue::StringHolder(&kField1)),
CelProtoWrapper::CreateMessage(&bad_value, arena())}};
ASSERT_OK_AND_ASSIGN(
std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(
absl::Span<std::pair<CelValue, CelValue>>(args.data(), args.size())));
ASSERT_OK_AND_ASSIGN(std::unique_ptr<CelMap> cel_map,
CreateContainerBackedMap(absl::MakeSpan(args)));
auto cel_value = CelValue::CreateMap(cel_map.get());
Value json;
ExpectNotWrapped(cel_value, json);
Expand Down
Loading