Skip to content

Commit

Permalink
simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Oct 9, 2024
1 parent 4ca95c3 commit a9eebac
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/feature_resolution_editions.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ tape.test("feature resolution inheritance message to oneofs", function(test) {
message Message {
option features.json_format = LEGACY_BEST_EFFORT;
oneof SomeOneOf {
option features.json_format = ALLOW;
int32 a = 13;
string b = 14;
}
Expand All @@ -221,7 +220,7 @@ tape.test("feature resolution inheritance message to oneofs", function(test) {
test.same(rootEditionsOverriden.lookup("SomeOneOf")._features, {
enum_type: 'OPEN',
field_presence: 'EXPLICIT',
json_format: 'ALLOW',
json_format: 'LEGACY_BEST_EFFORT',
message_encoding: 'LENGTH_PREFIXED',
repeated_field_encoding: 'PACKED',
utf8_validation: 'VERIFY',
Expand Down Expand Up @@ -289,18 +288,20 @@ tape.test("feature resolution inheritance message to extensions", function(test)
option features.json_format = LEGACY_BEST_EFFORT;
option features.(abc).d_e = deeply_nested_false;
extend Message {
int32 bar = 10 [features.utf8_validation = NONE];
}
message Message {}`).root.resolveAll();
message Message {
option features.utf8_validation = NONE;
extend Message {
int32 bar = 10 [features.utf8_validation = VERIFY];
}
}`).root.resolveAll();

test.same(rootEditionsOverriden.lookup(".bar")._features, {
enum_type: 'OPEN',
field_presence: 'EXPLICIT',
json_format: 'LEGACY_BEST_EFFORT',
message_encoding: 'LENGTH_PREFIXED',
repeated_field_encoding: 'PACKED',
utf8_validation: 'NONE',
utf8_validation: 'VERIFY',
'(abc)': { d_e: 'deeply_nested_false' }
})

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

tape.test("feature resolution inheritance message to enum", function(test) {
tape.test("feature resolution inheritance file to enum", function(test) {

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

0 comments on commit a9eebac

Please sign in to comment.