Skip to content

Conversation

@smaye81
Copy link
Contributor

@smaye81 smaye81 commented May 20, 2025

Fixes #257

This adds conformance testing to our implementation of string.format. cel-python does not currently provide a string.format function so we implement our own and add it to the protovalidate-python CEL runtime.

While formatting is not (yet) a part of the cel-spec, they do provide conformance test data for validating behavior. So, to ensure we are conformant, we use this test data and run it against our implementation.

See the test data here. Note that this file contains various sections for testing. However, we are only concerned with the format and format_errors sections. In addition, since we are only testing for formatting, we do not handle every oneof case or variation in the SimpleTest definition -- only expected results or evaluation errors. If others are added down the road in future versions of the spec, we can adjust these tests.

@smaye81 smaye81 requested review from Alfus and rodaine May 20, 2025 15:59
@smaye81 smaye81 merged commit 6196d2e into main May 20, 2025
12 checks passed
@smaye81 smaye81 deleted the sayers/format_tests branch May 20, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fully test and fix types in StringFormat implementation

3 participants