Skip to content

Commit

Permalink
More HRANDFIELD tests (#2580)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Jul 8, 2021
1 parent 3020133 commit 50c0eb5
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import static redis.clients.jedis.tests.utils.AssertUtil.assertCollectionContains;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
Expand Down Expand Up @@ -468,6 +469,10 @@ public void testBinaryHstrLen() {

@Test
public void hrandfield() {
assertNull(jedis.hrandfield("foo"));
assertEquals(Collections.emptyList(), jedis.hrandfield("foo", 1));
assertEquals(Collections.emptyMap(), jedis.hrandfieldWithValues("foo", 1));

Map<String, String> hash = new LinkedHashMap<>();
hash.put("bar", "bar");
hash.put("car", "car");
Expand All @@ -485,6 +490,10 @@ public void hrandfield() {
assertEquals(hash.get(entry.getKey()), entry.getValue());

// binary
assertNull(jedis.hrandfield(bfoo));
assertEquals(Collections.emptyList(), jedis.hrandfield(bfoo, 1));
assertEquals(Collections.emptyMap(), jedis.hrandfieldWithValues(bfoo, 1));

Map<byte[], byte[]> bhash = new JedisByteHashMap();
bhash.put(bbar, bbar);
bhash.put(bcar, bcar);
Expand Down

0 comments on commit 50c0eb5

Please sign in to comment.