Skip to content

Commit

Permalink
Add test for HMGET
Browse files Browse the repository at this point in the history
  • Loading branch information
mranney committed Sep 19, 2010
1 parent 75f1344 commit 09f1564
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,25 @@ tests.HSET = function () {

// Empty value
client.HSET(key, field1, value2, require_number(0, name));
client.HGET(key, field1, require_string("", name));
client.HGET([key, field1], require_string("", name));

// Empty key, empty value
client.HSET(key, field2, value1, require_number(1, name));
client.HSET([key, field2, value1], require_number(1, name));
client.HSET(key, field2, value2, require_number(0, name));
};

tests.HMGET = function () {
var key = "test hash", name = "HMGET";

client.HMSET(key, "0123456789", "abcdefghij", "some manner of key", "a type of value", require_string("OK", name));

client.HMGET(key, "0123456789", "some manner of key", function (err, reply) {
assert.strictEqual("abcdefghij", reply[0].toString(), name);
assert.strictEqual("a type of value", reply[1].toString(), name);
next(name);
});
};

tests.EXISTS = function () {
var name = "EXISTS";
client.del("foo", "foo2", require_number_any(name));
Expand Down

0 comments on commit 09f1564

Please sign in to comment.