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

Function TEST_F

bolt/expression/tests/TryExprTest.cpp:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51};
52
53TEST_F(TryExprTest, tryExpr) {
54 auto a = makeFlatVector<int32_t>({10, 20, 30, 20, 50, 30});
55 auto b = makeFlatVector<int32_t>({1, 0, 3, 4, 0, 6});
56 {
57 auto result = evaluate("try(c0 / c1)", makeRowVector({a, b}));
58
59 auto expectedResult = makeNullableFlatVector<int32_t>(
60 {10, std::nullopt, 10, 5, std::nullopt, 5});
61 assertEqualVectors(expectedResult, result);
62 }
63
64 auto c = makeNullableFlatVector<StringView>({"1", "2x", "3", "4", "5y"});
65 {
66 auto result = evaluate("try(cast(c0 as integer))", makeRowVector({c}));
67 auto expectedResult =
68 makeNullableFlatVector<int32_t>({1, std::nullopt, 3, 4, std::nullopt});
69 assertEqualVectors(expectedResult, result);
70 }
71}
72
73// Returns the number of times this function has been called so far.
74template <typename T>

Callers

nothing calls this directly

Calls 14

evaluateFunction · 0.85
ARRAYFunction · 0.85
wrapInDictionaryFunction · 0.85
makeNullsFunction · 0.85
DECIMALFunction · 0.85
has_valueMethod · 0.80
assertEqualVectorsFunction · 0.50
poolFunction · 0.50
registerVectorFunctionFunction · 0.50
signaturesFunction · 0.50
makeIndicesFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected