| 983 | } |
| 984 | |
| 985 | void CheckUnifyFailsTypeError( |
| 986 | const std::shared_ptr<Field>& field1, const std::shared_ptr<Field>& field2, |
| 987 | const Field::MergeOptions& options = Field::MergeOptions::Defaults(), |
| 988 | const std::string& match_message = "") { |
| 989 | ARROW_SCOPED_TRACE("options: ", options); |
| 990 | ARROW_SCOPED_TRACE("field2: ", field2->ToString()); |
| 991 | ARROW_SCOPED_TRACE("field1: ", field1->ToString()); |
| 992 | ASSERT_RAISES(TypeError, field1->MergeWith(field2, options)); |
| 993 | ASSERT_RAISES(TypeError, field2->MergeWith(field1, options)); |
| 994 | EXPECT_RAISES_WITH_MESSAGE_THAT(TypeError, ::testing::HasSubstr(match_message), |
| 995 | field1->MergeWith(field2, options)); |
| 996 | EXPECT_RAISES_WITH_MESSAGE_THAT(TypeError, ::testing::HasSubstr(match_message), |
| 997 | field2->MergeWith(field1, options)); |
| 998 | } |
| 999 | |
| 1000 | void CheckPromoteTo( |
| 1001 | const std::shared_ptr<DataType>& left, const std::shared_ptr<DataType>& right, |