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

Method TestGetWithInvalidIndex

cpp/src/arrow/field_ref_test.cc:272–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270
271 template <typename I, bool Flattened = false>
272 void TestGetWithInvalidIndex() const {
273 const auto& input = case_->InputAs<I>();
274 for (const auto& path :
275 {FieldPath({2, 1, 0}), FieldPath({1, 2, 0}), FieldPath{1, 1, 2}}) {
276 EXPECT_RAISES_WITH_MESSAGE_THAT(IndexError,
277 ::testing::HasSubstr("index out of range"),
278 DoGet<Flattened>(*input, path));
279 }
280 EXPECT_RAISES_WITH_MESSAGE_THAT(
281 Invalid, ::testing::HasSubstr("empty indices cannot be traversed"),
282 DoGet<Flattened>(*input, FieldPath()));
283 }
284
285 template <typename I, bool Flattened = false>
286 void TestIndexErrorMessage() const {

Callers

nothing calls this directly

Calls 1

FieldPathFunction · 0.85

Tested by

no test coverage detected