Commit 6196d2e
authored
Add conformance testing to string.format implementation (#307)
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](https://github.com/google/cel-spec/blob/master/tests/simple/testdata/string_ext.textproto).
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.1 parent 2559d06 commit 6196d2e
File tree
25 files changed
+3438
-102
lines changed- gen/cel/expr
- conformance
- test
- protovalidate/internal
- tests
- testdata
25 files changed
+3438
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
49 | | - | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments