1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Arguments passed as arrays should not be mutated. Fixes #866

This commit is contained in:
Ruben Bridgewater
2015-09-24 00:31:55 +02:00
parent f29193a7e0
commit 7be7128b2b
4 changed files with 25 additions and 11 deletions

View File

@@ -30,8 +30,10 @@ describe("The 'hmget' method", function () {
});
});
it('allows keys to be specified by passing an array', function (done) {
client.HMGET(hash, ["0123456789", "some manner of key"], function (err, reply) {
it('allows keys to be specified by passing an array without manipulating the array', function (done) {
var data = ["0123456789", "some manner of key"];
client.HMGET(hash, data, function (err, reply) {
assert.strictEqual(data.length, 2);
assert.strictEqual("abcdefghij", reply[0].toString());
assert.strictEqual("a type of value", reply[1].toString());
return done(err);