-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Emit an error on resolveAll() if any extension fields cannot be …
…resolved, see #595 + test case
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
|
||
message A { | ||
message B { | ||
message One { | ||
extensions 1000 to max; | ||
} | ||
} | ||
message C { | ||
message Two { | ||
extend One { | ||
Two two = 1000; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var tape = require("tape"); | ||
|
||
var protobuf = require(".."); | ||
|
||
tape.test("extensions", function(test) { | ||
|
||
protobuf.load("tests/data/extend.proto", function(err, root) { | ||
if (err) | ||
return test.fail(err.message); | ||
root.resolveAll(); | ||
test.pass("should parse and resolve without errors"); | ||
test.end(); | ||
}); | ||
|
||
}); |