-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
…e + removed now unused Writer#ldelim parameter, see #585
- 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.
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.
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.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var tape = require("tape"); | ||
|
||
var protobuf = require(".."); | ||
|
||
tape.test("empty inner message fields", function(test) { | ||
var root = protobuf.Root.fromJSON({ | ||
nested: { | ||
Inner: { | ||
fields: { | ||
} | ||
}, | ||
Outer: { | ||
oneofs: { | ||
child: { | ||
oneof: ["inner"] | ||
} | ||
}, | ||
fields: { | ||
inner: { | ||
id: 1, | ||
type: "Inner" | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
var Outer = root.lookup("Outer"); | ||
var msg = Outer.from({ | ||
inner: {} | ||
}); | ||
var buf = Outer.encode(msg).finish(); | ||
test.equal(buf.length, 2, "should always be present on the wire"); | ||
test.equal(buf[0], 1 << 3 | 2, "should write id 1, wireType 2"); | ||
test.equal(buf[1], 0, "should write a length of 0"); | ||
test.end(); | ||
}); |