-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
syntax = "proto3"; | ||
import "google/protobuf/descriptor.proto"; | ||
|
||
message MyOptions { | ||
string a = 1; | ||
string b = 2; | ||
} | ||
|
||
extend google.protobuf.FieldOptions { | ||
MyOptions my_options = 50000; | ||
} | ||
|
||
message Test { | ||
string value = 1 [(my_options) = { a: "foo" b: "bar" }]; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var tape = require("tape"); | ||
|
||
var protobuf = require(".."); | ||
|
||
tape.test("options in textformat", function(test) { | ||
|
||
protobuf.load("tests/data/options-textformat.proto", function(err, root) { | ||
if (err) | ||
throw err; | ||
var Test = root.lookup("Test"); | ||
test.same(Test.fields.value.options, { "(my_options).a": "foo", "(my_options).b": "bar" }, "should parse correctly"); | ||
test.end(); | ||
}); | ||
|
||
}); |