From 062caa5a3628043547730cd81e3fad9b4cfdf209 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Thu, 26 Sep 2024 12:06:17 -0700 Subject: [PATCH] fix test --- src/object.js | 2 +- src/parse.js | 2 +- tests/data/feature-resolution.proto | 62 ----------------------------- 3 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 tests/data/feature-resolution.proto diff --git a/src/object.js b/src/object.js index 329666d36..b9f977666 100644 --- a/src/object.js +++ b/src/object.js @@ -217,7 +217,7 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu if (!this.parsedOptions) { this.parsedOptions = []; } - var isFeature = /^features\./.test(name); + var isFeature = /^features$/.test(name); var parsedOptions = this.parsedOptions; if (propName) { // If setting a sub property of an option then try to merge it diff --git a/src/parse.js b/src/parse.js index 44ba4aedb..0c661de11 100644 --- a/src/parse.js +++ b/src/parse.js @@ -640,7 +640,7 @@ function parse(source, root, options) { dummy.setParsedOption = function(name, value, propName) { // In order to not change existing behavior, only calling // this for features - if (/^features\./.test(name)) { + if (/^features$/.test(name)) { return ReflectionObject.prototype.setParsedOption.call(dummy, name, value, propName); } return undefined; diff --git a/tests/data/feature-resolution.proto b/tests/data/feature-resolution.proto deleted file mode 100644 index 023dbe2d2..000000000 --- a/tests/data/feature-resolution.proto +++ /dev/null @@ -1,62 +0,0 @@ -edition = "2023"; - -option features.amazing_feature = A; -option (mo_single_msg).nested.value = "x"; -service MyService { - option features.amazing_feature = E; - message MyRequest {}; - message MyResponse {}; - rpc MyMethod (MyRequest) returns (MyResponse) { - option features.amazing_feature = L; - }; -} - -message Message { - option features.amazing_feature = B; - - string string_val = 1; - string string_repeated = 2 [features.amazing_feature = F]; - - uint64 uint64_val = 3; - uint64 uint64_repeated = 4; - - bytes bytes_val = 5; - bytes bytes_repeated = 6; - - SomeEnum enum_val = 7; - SomeEnum enum_repeated = 8; - - extensions 10 to 100; - extend Message { - int32 bar = 10 [features.amazing_feature = I]; - } - - message Nested { - option features.amazing_feature = H; - int64 count = 9; - } - - enum SomeEnumInMessage { - option features.amazing_feature = G; - ONE = 11; - TWO = 12; - } - - oneof SomeOneOf { - option features.amazing_feature = J; - int32 a = 13; - string b = 14; - } - - map int64_map = 15; -} - -extend Message { - int32 bar = 16 [features.amazing_feature = D]; -} - -enum SomeEnum { - option features.amazing_feature = C; - ONE = 1 [features.amazing_feature = K]; - TWO = 2; -}