Skip to content

Commit a9eebac

Browse files
committed
simplify tests
1 parent 4ca95c3 commit a9eebac

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/feature_resolution_editions.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ tape.test("feature resolution inheritance message to oneofs", function(test) {
212212
message Message {
213213
option features.json_format = LEGACY_BEST_EFFORT;
214214
oneof SomeOneOf {
215-
option features.json_format = ALLOW;
216215
int32 a = 13;
217216
string b = 14;
218217
}
@@ -221,7 +220,7 @@ tape.test("feature resolution inheritance message to oneofs", function(test) {
221220
test.same(rootEditionsOverriden.lookup("SomeOneOf")._features, {
222221
enum_type: 'OPEN',
223222
field_presence: 'EXPLICIT',
224-
json_format: 'ALLOW',
223+
json_format: 'LEGACY_BEST_EFFORT',
225224
message_encoding: 'LENGTH_PREFIXED',
226225
repeated_field_encoding: 'PACKED',
227226
utf8_validation: 'VERIFY',
@@ -289,18 +288,20 @@ tape.test("feature resolution inheritance message to extensions", function(test)
289288
option features.json_format = LEGACY_BEST_EFFORT;
290289
option features.(abc).d_e = deeply_nested_false;
291290
292-
extend Message {
293-
int32 bar = 10 [features.utf8_validation = NONE];
294-
}
295-
message Message {}`).root.resolveAll();
291+
message Message {
292+
option features.utf8_validation = NONE;
293+
extend Message {
294+
int32 bar = 10 [features.utf8_validation = VERIFY];
295+
}
296+
}`).root.resolveAll();
296297

297298
test.same(rootEditionsOverriden.lookup(".bar")._features, {
298299
enum_type: 'OPEN',
299300
field_presence: 'EXPLICIT',
300301
json_format: 'LEGACY_BEST_EFFORT',
301302
message_encoding: 'LENGTH_PREFIXED',
302303
repeated_field_encoding: 'PACKED',
303-
utf8_validation: 'NONE',
304+
utf8_validation: 'VERIFY',
304305
'(abc)': { d_e: 'deeply_nested_false' }
305306
})
306307

@@ -333,7 +334,7 @@ tape.test("feature resolution inheritance message to enum", function(test) {
333334
test.end();
334335
});
335336

336-
tape.test("feature resolution inheritance message to enum", function(test) {
337+
tape.test("feature resolution inheritance file to enum", function(test) {
337338

338339
var rootEditionsOverriden = protobuf.parse(`edition = "2023";
339340
option features.json_format = LEGACY_BEST_EFFORT;

0 commit comments

Comments
 (0)