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

Add test for multi with array args.

This commit is contained in:
Matt Ranney
2010-09-24 18:45:39 -07:00
parent a664565922
commit a21607100b

21
test.js
View File

@@ -167,6 +167,22 @@ tests.MULTI_4 = function () {
}); });
}; };
tests.MULTI_5 = function () {
var name = "MULTI_5";
// test nested multi-bulk replies with nulls.
client.multi([
["mget", ["multifoo", "some", "random value", "keys"]],
["incr", "multifoo"]
])
.exec(function (err, replies) {
assert.strictEqual(replies.length, 2, name);
assert.strictEqual(replies[0].length, 4, name);
next(name);
});
};
tests.HMGET = function () { tests.HMGET = function () {
var key = "test hash", name = "HMGET"; var key = "test hash", name = "HMGET";
@@ -175,6 +191,11 @@ tests.HMGET = function () {
client.HMGET(key, "0123456789", "some manner of key", function (err, reply) { client.HMGET(key, "0123456789", "some manner of key", function (err, reply) {
assert.strictEqual("abcdefghij", reply[0].toString(), name); assert.strictEqual("abcdefghij", reply[0].toString(), name);
assert.strictEqual("a type of value", reply[1].toString(), name); assert.strictEqual("a type of value", reply[1].toString(), name);
});
client.HMGET(key, "missing thing", "another missing thing", function (err, reply) {
assert.strictEqual(null, reply[0], name);
assert.strictEqual(null, reply[1], name);
next(name); next(name);
}); });
}; };