THRIFT-3409 NodeJS binary field issues
Client: Node.js
Patch: Nobuaki Sukegawa
This closes #681
diff --git a/lib/nodejs/test/test_driver.js b/lib/nodejs/test/test_driver.js
index 09439e5..590d583 100644
--- a/lib/nodejs/test/test_driver.js
+++ b/lib/nodejs/test/test_driver.js
@@ -57,6 +57,23 @@
testCases.deep.forEach(makeAsserter(assert.deepEqual));
testCases.deepUnordered.forEach(makeAsserter(makeUnorderedDeepEqual(assert)));
+ var arr = [];
+ for (var i = 0; i < 256; ++i) {
+ arr[i] = 255 - i;
+ }
+ var buf = new Buffer(arr);
+ client.testBinary(buf, function(err, response) {
+ assert.error(err, 'testBinary: no callback error');
+ assert.equal(response.length, 256, 'testBinary');
+ assert.deepEqual(response, buf, 'testBinary(Buffer)');
+ });
+ var buf = new Buffer(arr);
+ client.testBinary(buf.toString('binary'), function(err, response) {
+ assert.error(err, 'testBinary: no callback error');
+ assert.equal(response.length, 256, 'testBinary');
+ assert.deepEqual(response, buf, 'testBinary(string)');
+ });
+
client.testMapMap(42, function(err, response) {
var expected = {
"4": {"1":1, "2":2, "3":3, "4":4},