Skip to content

Commit

Permalink
feature: support hkeys protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes committed Apr 22, 2024
1 parent 840517c commit d177d9d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/test/java/icu/funkye/redispike/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ public void testKeys() {
}
}

@Test
public void testhHash2() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
Map<String, String> map = new HashMap<>();
map.put("b", "c");
map.put("d", "e");
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
long result = jedis.hset(key, map);
Assertions.assertEquals(result, 2);
Set<String> set = jedis.hkeys(key);
Assertions.assertTrue(set.containsAll(map.keySet()));
}
}

@Test
public void testhHash() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
Expand All @@ -163,8 +177,6 @@ public void testhHash() {
map.put("d", "e");
result = jedis.hset(key, map);
Assertions.assertEquals(result, 2);
Set<String> set = jedis.hkeys(key);
Assertions.assertTrue(set.containsAll(map.keySet()));
List<String> list = jedis.hmget(key, "b", "d");
Assertions.assertEquals(list.size(), 2);
list = jedis.hvals(key);
Expand Down

0 comments on commit d177d9d

Please sign in to comment.