MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / PerformBetweenToDStrTest

Method PerformBetweenToDStrTest

eval/public/extension_func_test.cc:221–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219 }
220
221 void PerformBetweenToDStrTest(Arena* arena,
222 const google::protobuf::Message* time_of_day,
223 std::string* start, std::string* stop,
224 CelValue* result) {
225 auto functions = registry_.FindOverloads(
226 "between", true,
227 {CelValue::Type::kMessage, CelValue::Type::kString,
228 CelValue::Type::kString});
229 ASSERT_EQ(functions.size(), 1);
230
231 auto func = functions[0];
232
233 std::vector<CelValue> args = {
234 CelProtoWrapper::CreateMessage(time_of_day, arena),
235 CelValue::CreateString(start), CelValue::CreateString(stop)};
236 absl::Span<CelValue> arg_span(&args[0], args.size());
237 auto status = func->Evaluate(arg_span, result, arena);
238
239 ASSERT_OK(status);
240 }
241
242 // Helper method to test duration() function
243 void PerformDurationConversion(Arena* arena, const std::string& ts_str,

Callers

nothing calls this directly

Calls 3

FindOverloadsMethod · 0.45
sizeMethod · 0.45
EvaluateMethod · 0.45

Tested by

no test coverage detected