Closed
Description
var protobufjs = require('protobufjs');
var ro = protobufjs.loadSync('./test.proto');
var test = ro.lookup('test.Test');
var enc = test.encode({int_64: '-9095674951825889465'}).finish();
var dec = test.decode(enc);
if (dec.int_64 === '-9095674951825889465') {
console.log('Test passed.');
} else {
console.log(dec.int_64 + ' != -9095674951825889465 (expected)');
}
syntax = "proto3";
package test;
message Test {
sfixed64 int_64 = 1;
}
Output:
-27182818284590 != -9095674951825889465 (expected)
Extracted from a failing test case in grpc. Tested with both long
and no long
installed. Node v6.9.1