diff --git a/src/test/java/redis/clients/jedis/tests/commands/SortingCommandsTest.java b/src/test/java/redis/clients/jedis/tests/commands/SortingCommandsTest.java index 59508c8..6afba8f 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/SortingCommandsTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/SortingCommandsTest.java @@ -45,6 +45,29 @@ public class SortingCommandsTest extends Assert { assertEquals(expected, result); } + @Test + public void sortBy() throws JedisException { + jedis.lpush("foo", "2"); + jedis.lpush("foo", "3"); + jedis.lpush("foo", "1"); + + jedis.set("bar1", "3"); + jedis.set("bar2", "2"); + jedis.set("bar3", "1"); + + SortingParams sp = new SortingParams(); + sp.by("bar*"); + + List result = jedis.sort("foo", sp); + + List expected = new ArrayList(); + expected.add("3"); + expected.add("2"); + expected.add("1"); + + assertEquals(expected, result); + } + @Test public void sortDesc() throws JedisException { jedis.lpush("foo", "3");