Skip to content

Commit

Permalink
Merge branch 'nick-apperson-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
brycebaril committed May 18, 2014
2 parents 7fb4bc7 + 01975f6 commit fd164c4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

## v0.10.2 - May 18, 2014

* Fix test not resetting `error` handler. (CrypticSwarm)
* Fix SELECT error semantics. (Bryan English)

## v0.10.1 - February 17, 2014

* Skip plucking redis version from the INFO stream if INFO results weren't provided. (Robert Sköld)
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ function reply_to_object(reply) {
}

for (j = 0, jl = reply.length; j < jl; j += 2) {
key = reply[j].toString();
key = reply[j].toString('binary');
val = reply[j + 1];
obj[key] = val;
}
Expand Down
15 changes: 15 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,21 @@ tests.HGETALL = function () {
});
};

tests.HGETALL_2 = function () {
var name = "HGETALL (Binary client)";
bclient.hmset(["bhosts", "mjr", "1", "another", "23", "home", "1234", new Buffer([0xAA, 0xBB, 0x00, 0xF0]), new Buffer([0xCC, 0xDD, 0x00, 0xF0])], require_string("OK", name));
bclient.HGETALL(["bhosts"], function (err, obj) {
assert.strictEqual(null, err, name + " result sent back unexpected error: " + err);
assert.strictEqual(4, Object.keys(obj).length, name);
assert.strictEqual("1", obj.mjr.toString(), name);
assert.strictEqual("23", obj.another.toString(), name);
assert.strictEqual("1234", obj.home.toString(), name);
assert.strictEqual((new Buffer([0xAA, 0xBB, 0x00, 0xF0])).toString('binary'), Object.keys(obj)[3], name);
assert.strictEqual((new Buffer([0xCC, 0xDD, 0x00, 0xF0])).toString('binary'), obj[(new Buffer([0xAA, 0xBB, 0x00, 0xF0])).toString('binary')].toString('binary'), name);
next(name);
});
};

tests.HGETALL_MESSAGE = function () {
var name = "HGETALL_MESSAGE";
client.hmset("msg_test", {message: "hello"}, require_string("OK", name));
Expand Down

0 comments on commit fd164c4

Please sign in to comment.