public void sortLimit() {
for (int n = 10; n > 0; n--) {
jedis.lpush("foo", String.valueOf(n));
}
SortingParams sp = new SortingParams();
sp.limit(0, 3);
List<String> result = jedis.sort("foo", sp);
List<String> expected = new ArrayList<String>();
expected.add("1");
expected.add("2");
expected.add("3");
assertEquals(expected, result);
// Binary
jedis.rpush(bfoo, new byte[] { (byte) '4' });
jedis.rpush(bfoo, new byte[] { (byte) '3' });
jedis.rpush(bfoo, new byte[] { (byte) '2' });
jedis.rpush(bfoo, new byte[] { (byte) '1' });
SortingParams bsp = new SortingParams();
bsp.limit(0, 3);
List<byte[]> bresult = jedis.sort(bfoo, bsp);
List<byte[]> bexpected = new ArrayList<byte[]>();
bexpected.add(b1);