From 07b1edd3410473fd7992fc1e9e6b53062f005edf Mon Sep 17 00:00:00 2001 From: CEL Dev Team Date: Fri, 3 Oct 2025 10:37:36 -0700 Subject: [PATCH] Print the returned error if a value was expected. PiperOrigin-RevId: 814747317 --- testing/testrunner/runner_lib.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/testrunner/runner_lib.cc b/testing/testrunner/runner_lib.cc index 2b0375f91..525feda00 100644 --- a/testing/testrunner/runner_lib.cc +++ b/testing/testrunner/runner_lib.cc @@ -288,6 +288,10 @@ MATCHER_P(MatchesValue, expected, "") { return IsEqual(arg, expected); } void TestRunner::AssertValue(const cel::Value& computed, const TestOutput& output, google::protobuf::Arena* arena) { + if (computed.IsError()) { + ADD_FAILURE() << "Expected value but got error: " << computed.DebugString(); + return; + } ValueProto expected_value_proto; const auto* descriptor_pool = GetDescriptorPool(*test_context_); auto* message_factory = GetMessageFactory(*test_context_);