MCPcopy Create free account
hub / github.com/bytedance/bolt / TEST_F

Function TEST_F

bolt/vector/tests/VectorToStringTest.cpp:41–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39};
40
41TEST_F(VectorToStringTest, flatIntegers) {
42 // No nulls.
43 auto flat = makeFlatVector<int32_t>({1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
44 ASSERT_EQ(flat->toString(), "[FLAT INTEGER: 10 elements, no nulls]");
45 ASSERT_EQ(flat->toString(true), "[FLAT INTEGER: 10 elements, no nulls]");
46 ASSERT_EQ(flat->toString(1), "2");
47 ASSERT_EQ(flat->toString(3, 8, ", ", false), "4, 5, 6, 7, 8");
48
49 // With nulls.
50 flat = makeFlatVector<int32_t>(
51 100, [](auto row) { return row; }, nullEvery(3));
52 ASSERT_EQ(flat->toString(), "[FLAT INTEGER: 100 elements, 34 nulls]");
53 ASSERT_EQ(flat->toString(true), "[FLAT INTEGER: 100 elements, 34 nulls]");
54 ASSERT_EQ(flat->toString(1), "1");
55 ASSERT_EQ(flat->toString(33), "null");
56 ASSERT_EQ(flat->toString(0, 7, ", ", false), "null, 1, 2, null, 4, 5, null");
57}
58
59TEST_F(VectorToStringTest, arrayOfIntegers) {
60 // No nulls.

Callers

nothing calls this directly

Calls 15

DECIMALFunction · 0.85
wrapInDictionaryFunction · 0.85
makeIndicesInReverseFunction · 0.85
makeNullsFunction · 0.85
allocateNullsFunction · 0.85
printNullsFunction · 0.85
allocateIndicesFunction · 0.85
printIndicesFunction · 0.85
createFunction · 0.50
makeIndicesFunction · 0.50
poolFunction · 0.50
setNullFunction · 0.50

Tested by

no test coverage detected