mirror of
https://github.com/hanzoai/protobuf.js.git
synced 2026-09-24 17:02:08 +00:00
15 lines
543 B
JavaScript
15 lines
543 B
JavaScript
var tape = require("tape");
|
|
var protobuf = require("..");
|
|
|
|
tape.test("imports after declarations", function(test) {
|
|
var parsed = protobuf.parse("syntax = \"proto3\";" +
|
|
"message Foo { string name = 1; }" +
|
|
"import \"bar.proto\";" +
|
|
"enum Status { UNKNOWN = 0; }" +
|
|
"import weak \"baz.proto\";");
|
|
|
|
test.deepEqual(parsed.imports, [ "bar.proto" ], "should parse imports after messages");
|
|
test.deepEqual(parsed.weakImports, [ "baz.proto" ], "should parse weak imports after enums");
|
|
test.end();
|
|
});
|