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

Method TestBasics

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

Source from the content-addressed store, hash-verified

993 void SetUp() override { type_ = TypeTraits<TypeClass>::type_singleton(); }
994
995 void TestBasics() {
996 auto array = ArrayFromJSON(
997 type_,
998 R"(["foo", null, "bar", "inline_me", "allocate_me_aaaaa", "allocate_me_bbbb"])");
999 BinaryAppender appender;
1000 ArraySpanVisitor<TypeClass> visitor;
1001 ASSERT_OK(visitor.Visit(*array->data(), &appender));
1002 ASSERT_THAT(appender.data,
1003 ::testing::ElementsAreArray({"foo", "(null)", "bar", "inline_me",
1004 "allocate_me_aaaaa", "allocate_me_bbbb"}));
1005 ARROW_UNUSED(visitor); // Workaround weird MSVC warning
1006 }
1007
1008 void TestSliced() {
1009 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