Skip to content

Commit 07b1edd

Browse files
CEL Dev Teamcopybara-github
authored andcommitted
Print the returned error if a value was expected.
PiperOrigin-RevId: 814747317
1 parent 538788f commit 07b1edd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

testing/testrunner/runner_lib.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ MATCHER_P(MatchesValue, expected, "") { return IsEqual(arg, expected); }
288288

289289
void TestRunner::AssertValue(const cel::Value& computed,
290290
const TestOutput& output, google::protobuf::Arena* arena) {
291+
if (computed.IsError()) {
292+
ADD_FAILURE() << "Expected value but got error: " << computed.DebugString();
293+
return;
294+
}
291295
ValueProto expected_value_proto;
292296
const auto* descriptor_pool = GetDescriptorPool(*test_context_);
293297
auto* message_factory = GetMessageFactory(*test_context_);

0 commit comments

Comments
 (0)