unittest_delimited.proto 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. edition = "2023";
  2. package editions_unittest;
  3. import "google/protobuf/unittest_delimited_import.proto";
  4. option java_multiple_files = true;
  5. // Test various scenarios that are now possible in edition 2023 that weren't in
  6. // google.protobuf.
  7. message LengthPrefixed {
  8. int32 a = 1;
  9. int32 b = 2;
  10. }
  11. message NotGroupLikeScope {
  12. int32 a = 1;
  13. int32 b = 2;
  14. }
  15. message GroupLikeFileScope {
  16. int32 a = 1;
  17. int32 b = 2;
  18. }
  19. message TestDelimited {
  20. message LengthPrefixed {
  21. int32 a = 1;
  22. int32 b = 2;
  23. }
  24. // Non-delimited field that otherwise looks group-like.
  25. LengthPrefixed lengthprefixed = 1;
  26. // Nested field for nested tests.
  27. TestDelimited nested = 2 [features.message_encoding = DELIMITED];
  28. message GroupLike {
  29. int32 a = 1;
  30. int32 b = 2;
  31. }
  32. // Truly group-like field.
  33. GroupLike grouplike = 3 [features.message_encoding = DELIMITED];
  34. // Delimited field that isn't group-like solely because of its name.
  35. GroupLike notgrouplike = 4 [features.message_encoding = DELIMITED];
  36. // Delimited field that isn't group-like because of the scope of its type.
  37. NotGroupLikeScope notgrouplikescope = 5
  38. [features.message_encoding = DELIMITED];
  39. // Delimited field that's grouplike except that it's an imported type.
  40. MessageImport messageimport = 6 [features.message_encoding = DELIMITED];
  41. extensions 1000 to max;
  42. }
  43. extend TestDelimited {
  44. // Non-delimited field that otherwise looks group-like.
  45. LengthPrefixed lengthprefixed = 1004;
  46. // Truly group-like extension.
  47. GroupLikeFileScope grouplikefilescope = 1000
  48. [features.message_encoding = DELIMITED];
  49. // Delimited extension that isn't group-like because of its name.
  50. NotGroupLikeScope not_group_like_scope = 1001
  51. [features.message_encoding = DELIMITED];
  52. // Delimited extension that isn't group-like because of the scope of its type.
  53. TestDelimited.GroupLike grouplike = 1002
  54. [features.message_encoding = DELIMITED];
  55. // Delimited extension that's grouplike except that it's an imported type.
  56. MessageImport messageimport = 1003 [features.message_encoding = DELIMITED];
  57. }