| 93 | |
| 94 | template <typename CompareFunctor> |
| 95 | void AssertArraysEqualWith(const Array& expected, const Array& actual, bool verbose, |
| 96 | CompareFunctor&& compare) { |
| 97 | std::stringstream diff; |
| 98 | if (!compare(expected, actual, &diff)) { |
| 99 | if (expected.data()->null_count != actual.data()->null_count) { |
| 100 | diff << "Null counts differ. Expected " << expected.data()->null_count |
| 101 | << " but was " << actual.data()->null_count << "\n"; |
| 102 | } |
| 103 | if (verbose) { |
| 104 | ::arrow::PrettyPrintOptions options(/*indent=*/2); |
| 105 | options.window = 50; |
| 106 | diff << "Expected:\n"; |
| 107 | ARROW_EXPECT_OK(PrettyPrint(expected, options, &diff)); |
| 108 | diff << "\nActual:\n"; |
| 109 | ARROW_EXPECT_OK(PrettyPrint(actual, options, &diff)); |
| 110 | } |
| 111 | FAIL() << diff.str(); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | void AssertArraysEqual(const Array& expected, const Array& actual, bool verbose, |
| 116 | const EqualOptions& options) { |
no test coverage detected