sortedSetRange tests

This commit is contained in:
barisusakli
2014-12-31 14:41:58 -05:00
parent 0ff37f9e0e
commit 00541b2bc8
2 changed files with 77 additions and 17 deletions

View File

@@ -100,6 +100,22 @@ module.exports = function(db, module) {
});
};
module.getSortedSetRange = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, 1, false, callback);
};
module.getSortedSetRevRange = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, -1, false, callback);
};
module.getSortedSetRangeWithScores = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, 1, true, callback);
};
module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, -1, true, callback);
};
function getSortedSetRange(key, start, stop, sort, withScores, callback) {
if (!key) {
return callback();
@@ -128,22 +144,6 @@ module.exports = function(db, module) {
});
}
module.getSortedSetRange = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, 1, false, callback);
};
module.getSortedSetRevRange = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, -1, false, callback);
};
module.getSortedSetRangeWithScores = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, 1, true, callback);
};
module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) {
getSortedSetRange(key, start, stop, -1, true, callback);
};
module.getSortedSetRangeByScore = function(key, start, count, min, max, callback) {
getSortedSetRangeByScore(key, start, count, min, max, 1, false, callback);
};