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

Method PerformBetweenTest

eval/public/extension_func_test.cc:97–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 void PerformBetweenTest(Arena* arena, absl::Time time_stamp,
98 absl::Time start_ts, absl::Time stop_ts,
99 CelValue* result) {
100 auto functions = registry_.FindOverloads(
101 "between", true,
102 {CelValue::Type::kTimestamp, CelValue::Type::kTimestamp,
103 CelValue::Type::kTimestamp});
104 ASSERT_EQ(functions.size(), 1);
105
106 auto func = functions[0];
107
108 std::vector<CelValue> args = {CelValue::CreateTimestamp(time_stamp),
109 CelValue::CreateTimestamp(start_ts),
110 CelValue::CreateTimestamp(stop_ts)};
111 absl::Span<CelValue> arg_span(&args[0], args.size());
112 auto status = func->Evaluate(arg_span, result, arena);
113
114 ASSERT_OK(status);
115 }
116
117 void PerformBetweenStrTest(Arena* arena, absl::Time time_stamp,
118 std::string* start, std::string* stop,

Callers

nothing calls this directly

Calls 3

FindOverloadsMethod · 0.45
sizeMethod · 0.45
EvaluateMethod · 0.45

Tested by

no test coverage detected