Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit test for mult-byte id on a packed field #68

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions test/compile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,19 @@ test('compiles packed proto3', function(t) {
t.end();
});

test('compiles packed proto3', function(t) {
test('compiles packed with multi-byte tags', function(t) {
var proto = resolve(path.join(__dirname, './fixtures/packed_proto3.proto'));
var NotPacked = compile(proto).NotPacked;
var FalsePacked = compile(proto).FalsePacked;
var Packed = compile(proto).Packed;

var original = {
value: [300, 400, 500]
};
var pbf = new Pbf();
NotPacked.write(original, pbf);
Packed.write(original, pbf);
var buf = pbf.finish();

var decompressed = FalsePacked.read(new Pbf(buf));
t.equals(buf.length, 8);
var decompressed = Packed.read(new Pbf(buf));
t.equals(buf.length, 9);
t.deepEqual(original, decompressed);

t.end();
Expand Down