wildfire chat server source initial submit

This commit is contained in:
heavyrain2012
2019-03-16 17:04:23 +08:00
parent e59217bd10
commit cab3ca0916
1466 changed files with 528862 additions and 15919 deletions
+19
View File
@@ -0,0 +1,19 @@
var tape = require("tape");
var protobuf = require("..");
tape.test("negative int32 values", function(test) {
var writer = protobuf.Writer.create();
writer.int32(-5615122);
var buf = writer.finish();
test.equal(buf.length, 10, "should encode to 10 bytes");
var reader = protobuf.Reader.create(buf);
test.equal(reader.int32(), -5615122, "should decode from 10 bytes");
test.equal(reader.pos, 10, "should have consumed the entire test buffer");
test.end();
});