Adding support for bit commands get/setrange

This commit is contained in:
Eric Hauser
2011-02-22 22:41:46 -05:00
committed by Jonathan Leibiusky
parent e12f655fa3
commit 430601f31e
9 changed files with 73 additions and 2 deletions

View File

@@ -17,4 +17,16 @@ public class BitCommandsTest extends JedisCommandTestBase {
bbit = jedis.getbit("bfoo".getBytes(), 0);
assertEquals(1, bbit);
}
@Test
public void setAndgetrange() {
jedis.set("key1", "Hello World");
long reply = jedis.setrange("key1", 6, "Jedis");
assertEquals(11, reply);
assertEquals(jedis.get("key1"), "Hello Jedis");
assertEquals("Hello", jedis.getrange("key1", 0, 4));
assertEquals("Jedis", jedis.getrange("key1", 6, 11));
}
}