You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
test.js: early return if command not supported
This commit is contained in:
31
test.js
31
test.js
@@ -289,7 +289,11 @@ tests.MULTI_6 = function () {
|
|||||||
tests.EVAL_1 = function () {
|
tests.EVAL_1 = function () {
|
||||||
var name = "EVAL_1";
|
var name = "EVAL_1";
|
||||||
|
|
||||||
if (server_version_at_least(client, [2, 5, 0])) {
|
if (!server_version_at_least(client, [2, 5, 0])) {
|
||||||
|
console.log("Skipping " + name + " for old Redis server version < 2.5.x");
|
||||||
|
return next(name);
|
||||||
|
}
|
||||||
|
|
||||||
// test {EVAL - Lua integer -> Redis protocol type conversion}
|
// test {EVAL - Lua integer -> Redis protocol type conversion}
|
||||||
client.eval("return 100.5", 0, require_number(100, name));
|
client.eval("return 100.5", 0, require_number(100, name));
|
||||||
// test {EVAL - Lua string -> Redis protocol type conversion}
|
// test {EVAL - Lua string -> Redis protocol type conversion}
|
||||||
@@ -413,41 +417,36 @@ tests.EVAL_1 = function () {
|
|||||||
next(name);
|
next(name);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log("Skipping " + name + " because server version isn't new enough.");
|
|
||||||
next(name);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tests.SCRIPT_LOAD = function() {
|
tests.SCRIPT_LOAD = function() {
|
||||||
if (server_version_at_least(bclient, [2, 5, 0])) {
|
|
||||||
var name = "SCRIPT_LOAD",
|
var name = "SCRIPT_LOAD",
|
||||||
command = "return 1",
|
command = "return 1",
|
||||||
commandSha = crypto.createHash('sha1').update(command).digest('hex');
|
commandSha = crypto.createHash('sha1').update(command).digest('hex');
|
||||||
|
|
||||||
|
if (!server_version_at_least(client, [2, 6, 0])) {
|
||||||
|
console.log("Skipping " + name + " for old Redis server version < 2.6.x");
|
||||||
|
return next(name);
|
||||||
|
}
|
||||||
|
|
||||||
bclient.script("load", command, function(err, result) {
|
bclient.script("load", command, function(err, result) {
|
||||||
assert.strictEqual(result.toString(), commandSha);
|
assert.strictEqual(result.toString(), commandSha);
|
||||||
next(name);
|
next(name);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
console.log("Skipping " + name + " because server version isn't new enough.");
|
|
||||||
next(name);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tests.WATCH_MULTI = function () {
|
tests.WATCH_MULTI = function () {
|
||||||
var name = 'WATCH_MULTI', multi;
|
var name = 'WATCH_MULTI', multi;
|
||||||
|
if (!server_version_at_least(client, [2, 2, 0])) {
|
||||||
|
console.log("Skipping " + name + " for old Redis server version < 2.2.x");
|
||||||
|
return next(name);
|
||||||
|
}
|
||||||
|
|
||||||
if (server_version_at_least(client, [2, 1, 0])) {
|
|
||||||
client.watch(name);
|
client.watch(name);
|
||||||
client.incr(name);
|
client.incr(name);
|
||||||
multi = client.multi();
|
multi = client.multi();
|
||||||
multi.incr(name);
|
multi.incr(name);
|
||||||
multi.exec(last(name, require_null(name)));
|
multi.exec(last(name, require_null(name)));
|
||||||
} else {
|
|
||||||
console.log("Skipping " + name + " because server version isn't new enough.");
|
|
||||||
next(name);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
tests.detect_buffers = function () {
|
tests.detect_buffers = function () {
|
||||||
@@ -1517,7 +1516,7 @@ tests.MONITOR = function () {
|
|||||||
var name = "MONITOR", responses = [], monitor_client;
|
var name = "MONITOR", responses = [], monitor_client;
|
||||||
|
|
||||||
if (!server_version_at_least(client, [2, 6, 0])) {
|
if (!server_version_at_least(client, [2, 6, 0])) {
|
||||||
console.log("Skipping monitor for old Redis server version <= 2.6.x");
|
console.log("Skipping " + name + " for old Redis server version < 2.6.x");
|
||||||
return next(name);
|
return next(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user