MCPcopy Create free account
hub / github.com/apache/arrow / AssertArraysEqualWith

Function AssertArraysEqualWith

cpp/src/arrow/testing/gtest_util.cc:91–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

AssertArraysEqualFunction · 0.85
AssertArraysApproxEqualFunction · 0.85

Calls 3

strMethod · 0.80
PrettyPrintFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected