Upgrading dependencies to gorealis v2 and thrift 0.12.0
This commit is contained in:
parent
7cbbea498b
commit
54b8d7942a
1327 changed files with 137391 additions and 61476 deletions
143
vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js
generated
vendored
143
vendor/git.apache.org/thrift.git/lib/nodejs/test/binary.test.js
generated
vendored
|
@ -17,19 +17,19 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
var test = require('tape');
|
||||
var binary = require('thrift/binary');
|
||||
const test = require("tape");
|
||||
const binary = require("thrift/binary");
|
||||
|
||||
var cases = {
|
||||
"Should read signed byte": function(assert){
|
||||
const cases = {
|
||||
"Should read signed byte": function(assert) {
|
||||
assert.equal(1, binary.readByte(0x01));
|
||||
assert.equal(-1, binary.readByte(0xFF));
|
||||
assert.equal(-1, binary.readByte(0xff));
|
||||
|
||||
assert.equal(127, binary.readByte(0x7F));
|
||||
assert.equal(127, binary.readByte(0x7f));
|
||||
assert.equal(-128, binary.readByte(0x80));
|
||||
assert.end();
|
||||
},
|
||||
"Should write byte": function(assert){
|
||||
"Should write byte": function(assert) {
|
||||
//Protocol simply writes to the buffer. Nothing to test.. yet.
|
||||
assert.ok(true);
|
||||
assert.end();
|
||||
|
@ -76,58 +76,135 @@ var cases = {
|
|||
assert.deepEqual([0xff, 0xff, 0xff, 0xff], binary.writeI32([], -1));
|
||||
|
||||
// Min I32
|
||||
assert.deepEqual([0x80, 0x00, 0x00, 0x00], binary.writeI32([], -2147483648));
|
||||
assert.deepEqual(
|
||||
[0x80, 0x00, 0x00, 0x00],
|
||||
binary.writeI32([], -2147483648)
|
||||
);
|
||||
// Max I32
|
||||
assert.deepEqual([0x7f, 0xff, 0xff, 0xff], binary.writeI32([], 2147483647));
|
||||
assert.end();
|
||||
},
|
||||
|
||||
"Should read doubles": function(assert) {
|
||||
assert.equal(0, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(0, binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(1, binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(2, binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(-2, binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(
|
||||
0,
|
||||
binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
assert.equal(
|
||||
0,
|
||||
binary.readDouble([0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
assert.equal(
|
||||
1,
|
||||
binary.readDouble([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
assert.equal(
|
||||
2,
|
||||
binary.readDouble([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
assert.equal(
|
||||
-2,
|
||||
binary.readDouble([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
|
||||
assert.equal(Math.PI, binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18]))
|
||||
assert.equal(
|
||||
Math.PI,
|
||||
binary.readDouble([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18])
|
||||
);
|
||||
|
||||
assert.equal(Infinity, binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(-Infinity, binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(
|
||||
Infinity,
|
||||
binary.readDouble([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
assert.equal(
|
||||
-Infinity,
|
||||
binary.readDouble([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
|
||||
assert.ok(isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])))
|
||||
assert.ok(
|
||||
isNaN(binary.readDouble([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
);
|
||||
|
||||
assert.equal(1/3, binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55]))
|
||||
assert.equal(
|
||||
1 / 3,
|
||||
binary.readDouble([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55])
|
||||
);
|
||||
|
||||
// Min subnormal positive double
|
||||
assert.equal(4.9406564584124654e-324, binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]))
|
||||
assert.equal(
|
||||
4.9406564584124654e-324,
|
||||
binary.readDouble([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01])
|
||||
);
|
||||
// Min normal positive double
|
||||
assert.equal(2.2250738585072014e-308, binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))
|
||||
assert.equal(
|
||||
2.2250738585072014e-308,
|
||||
binary.readDouble([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
|
||||
);
|
||||
// Max positive double
|
||||
assert.equal(1.7976931348623157e308, binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff]))
|
||||
assert.equal(
|
||||
1.7976931348623157e308,
|
||||
binary.readDouble([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff])
|
||||
);
|
||||
assert.end();
|
||||
},
|
||||
|
||||
"Should write doubles": function(assert) {
|
||||
assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 0));
|
||||
assert.deepEqual([0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 1));
|
||||
assert.deepEqual([0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2));
|
||||
assert.deepEqual([0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -2));
|
||||
assert.deepEqual(
|
||||
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], 0)
|
||||
);
|
||||
assert.deepEqual(
|
||||
[0x3f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], 1)
|
||||
);
|
||||
assert.deepEqual(
|
||||
[0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], 2)
|
||||
);
|
||||
assert.deepEqual(
|
||||
[0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], -2)
|
||||
);
|
||||
|
||||
assert.deepEqual([0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18], binary.writeDouble([], Math.PI));
|
||||
assert.deepEqual(
|
||||
[0x40, 0x9, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18],
|
||||
binary.writeDouble([], Math.PI)
|
||||
);
|
||||
|
||||
assert.deepEqual([0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], Infinity));
|
||||
assert.deepEqual([0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], -Infinity));
|
||||
assert.deepEqual(
|
||||
[0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], Infinity)
|
||||
);
|
||||
assert.deepEqual(
|
||||
[0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], -Infinity)
|
||||
);
|
||||
|
||||
assert.deepEqual([0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], NaN));
|
||||
assert.deepEqual(
|
||||
[0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], NaN)
|
||||
);
|
||||
|
||||
assert.deepEqual([0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55], binary.writeDouble([], 1/3));
|
||||
assert.deepEqual(
|
||||
[0x3f, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55],
|
||||
binary.writeDouble([], 1 / 3)
|
||||
);
|
||||
|
||||
// Min subnormal positive double
|
||||
assert.deepEqual([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], binary.writeDouble([], 4.9406564584124654e-324));
|
||||
assert.deepEqual(
|
||||
[0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],
|
||||
binary.writeDouble([], 4.9406564584124654e-324)
|
||||
);
|
||||
// Min normal positive double
|
||||
assert.deepEqual([0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], binary.writeDouble([], 2.2250738585072014e-308));
|
||||
assert.deepEqual(
|
||||
[0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00],
|
||||
binary.writeDouble([], 2.2250738585072014e-308)
|
||||
);
|
||||
// Max positive double
|
||||
assert.deepEqual([0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], binary.writeDouble([], 1.7976931348623157e308));
|
||||
assert.deepEqual(
|
||||
[0x7f, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff],
|
||||
binary.writeDouble([], 1.7976931348623157e308)
|
||||
);
|
||||
assert.end();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue