-
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.
fix: type names can be split into multiple tokens (#1877)
- Loading branch information
1 parent
e721d04
commit 8817ee6
Showing
3 changed files
with
40 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,14 @@ | ||
var tape = require("tape"); | ||
var protobuf = require(".."); | ||
|
||
tape.test("parsing line breaks", function (test) { | ||
|
||
test.test(test.name + " - field options (Int)", function (test) { | ||
var root = protobuf.loadSync("tests/data/whitespace-in-type.proto"); | ||
var message = root.lookupType('some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this.WouldYouParseThisForMePlease'); | ||
test.equal(message.fields.field.type, 'some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this.Test'); | ||
test.end(); | ||
}); | ||
|
||
test.end(); | ||
}); |
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"; | ||
|
||
package some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this; | ||
|
||
message WouldYouParseThisForMePlease { | ||
optional some.really.long. name . which . does .not | ||
.really.make.any. sense.but. | ||
sometimes.we.still | ||
. | ||
see.stuff .like.this | ||
.Test field = 1; | ||
} | ||
|
||
message Test { | ||
string field = 1; | ||
} |