[api] Pass the encode cursor by value through the protobuf helpers (#19014)

This commit is contained in:
J. Nick Koston
2026-09-24 14:25:50 +01:00
committed by GitHub
parent b0c9a7d5bd
commit da148bedfe
12 changed files with 1259 additions and 770 deletions
@@ -380,3 +380,13 @@ def test_api_version_minor_is_at_least_15() -> None:
"clients to see api_version >= 1.15 in HelloResponse before they will "
"ever request it."
)
def test_generated_encode_calls_keep_the_cursor() -> None:
"""No generated ProtoEncode call may drop the returned cursor."""
dropped = [
line
for line in CPP_TEXT.splitlines()
if "ProtoEncode::" in line and "pos = ProtoEncode::" not in line
]
assert not dropped, dropped[:5]