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

Method TestBasics

cpp/src/arrow/array/array_binary_test.cc:1018–1029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016 void SetUp() override { type_ = TypeTraits<TypeClass>::type_singleton(); }
1017
1018 void TestBasics() {
1019 auto array = ArrayFromJSON(
1020 type_,
1021 R"(["foo", null, "bar", "inline_me", "allocate_me_aaaaa", "allocate_me_bbbb"])");
1022 BinaryAppender appender;
1023 ArraySpanVisitor<TypeClass> visitor;
1024 ASSERT_OK(visitor.Visit(*array->data(), &appender));
1025 ASSERT_THAT(appender.data,
1026 ::testing::ElementsAreArray({"foo", "(null)", "bar", "inline_me",
1027 "allocate_me_aaaaa", "allocate_me_bbbb"}));
1028 ARROW_UNUSED(visitor); // Workaround weird MSVC warning
1029 }
1030
1031 void TestSliced() {
1032 auto array = ArrayFromJSON(type_, R"(["ab", null, "cd", "ef"])")->Slice(1, 2);

Callers 1

TYPED_TESTFunction · 0.45

Calls 3

ArrayFromJSONFunction · 0.85
VisitMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected