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

Add a lot more tests to indicate that the everything is consistent

Add a test for #390

More special cases
This commit is contained in:
Ruben Bridgewater
2015-09-15 00:57:31 +02:00
parent c522ca1264
commit a0c92b0756
11 changed files with 126 additions and 13 deletions

View File

@@ -83,6 +83,24 @@ describe("The 'hmset' method", function () {
});
});
it('allows a key plus array without callback', function (done) {
client.HMSET(hash, [99, 'banana', 'test', 25]);
client.HGETALL(hash, function (err, obj) {
assert.equal(obj['99'], 'banana');
assert.equal(obj.test, '25');
return done(err);
});
});
it('allows a key plus array and a callback', function (done) {
client.HMSET(hash, [99, 'banana', 'test', 25], helper.isString('OK'));
client.HGETALL(hash, function (err, obj) {
assert.equal(obj['99'], 'banana');
assert.equal(obj.test, '25');
return done(err);
});
});
it('handles object-style syntax without callback', function (done) {
client.HMSET(hash, {"0123456789": "abcdefghij", "some manner of key": "a type of value"});
client.HGETALL(hash, function (err, obj) {