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