Skip to content

Commit

Permalink
test: SORT with multiple patterns (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a authored Feb 16, 2023
1 parent e50699e commit 5229565
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/commands/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,31 @@ export function keyTests(
assertEquals(v, ["1", "3", "5", "10"]);
});

it("sort with multiple patterns", async () => {
// https://github.com/denodrivers/redis/pull/364
await client.rpush("ids", "1", "2", "3");
await client.mset({
"weight_1": "8",
"weight_2": "2",
"weight_3": "5",
"name_1": "foo",
"name_2": "bar",
"name_3": "baz",
});
const result = await client.sort("ids", {
by: "weight_*",
patterns: ["#", "name_*"],
});
assertEquals(result, [
"2",
"bar",
"3",
"baz",
"1",
"foo",
]);
});

it("touch", async () => {
await client.set("key1", "baz");
await client.set("key2", "qux");
Expand Down

0 comments on commit 5229565

Please sign in to comment.