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

Function AssertArraysEqualWith

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

Source from the content-addressed store, hash-verified

93
94template <typename CompareFunctor>
95void 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
115void AssertArraysEqual(const Array& expected, const Array& actual, bool verbose,
116 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