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

Method GetCheckedExpr

testing/testrunner/runner_lib.cc:381–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381absl::StatusOr<CheckedExpr> TestRunner::GetCheckedExpr() const {
382 const CelExpressionSource* source_ptr = test_context_->expression_source();
383 if (source_ptr == nullptr) {
384 return absl::InvalidArgumentError("No expression source provided.");
385 }
386 return std::visit(
387 absl::Overload([](const cel::expr::CheckedExpr& v)
388 -> absl::StatusOr<CheckedExpr> { return v; },
389 [this](const CelExpressionSource::RawExpression& v)
390 -> absl::StatusOr<CheckedExpr> {
391 return Compile(v.value, *test_context_);
392 },
393 [this](const CelExpressionSource::CelFile& v)
394 -> absl::StatusOr<CheckedExpr> {
395 CEL_ASSIGN_OR_RETURN(std::string contents,
396 ReadFileToString(v.path));
397 return Compile(contents, *test_context_);
398 }),
399 source_ptr->source());
400}
401
402absl::Status TestRunner::EnableCoverage() {
403 if (test_context_ != nullptr && test_context_->enable_coverage()) {

Callers 1

mainFunction · 0.80

Calls 2

CompileFunction · 0.85
expression_sourceMethod · 0.80

Tested by

no test coverage detected