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

Method TestBasics

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

Source from the content-addressed store, hash-verified

983 void SetUp() override { type_ = TypeTraits<TypeClass>::type_singleton(); }
984
985 void TestBasics() {
986 auto array = ArrayFromJSON(
987 type_,
988 R"(["foo", null, "bar", "inline_me", "allocate_me_aaaaa", "allocate_me_bbbb"])");
989 BinaryAppender appender;
990 ArraySpanVisitor<TypeClass> visitor;
991 ASSERT_OK(visitor.Visit(*array->data(), &appender));
992 ASSERT_THAT(appender.data,
993 ::testing::ElementsAreArray({"foo", "(null)", "bar", "inline_me",
994 "allocate_me_aaaaa", "allocate_me_bbbb"}));
995 ARROW_UNUSED(visitor); // Workaround weird MSVC warning
996 }
997
998 void TestSliced() {
999 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