Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <[email protected]>
  • Loading branch information
acarbonetto committed Sep 13, 2024
1 parent 655a939 commit 02bf43b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 32 deletions.
16 changes: 8 additions & 8 deletions node/src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5678,11 +5678,11 @@ export class BaseClient {
* ```
*/
public async xautoclaimJustId(
key: string,
group: string,
consumer: string,
key: GlideString,
group: GlideString,
consumer: GlideString,
minIdleTime: number,
start: string,
start: GlideString,
count?: number,
): Promise<[string, string[], string[]?]> {
return this.createWritePromise(
Expand Down Expand Up @@ -5720,11 +5720,11 @@ export class BaseClient {
* ```
*/
public async xclaimJustId(
key: string,
group: string,
consumer: string,
key: GlideString,
group: GlideString,
consumer: GlideString,
minIdleTime: number,
ids: string[],
ids: GlideString[],
options?: StreamClaimOptions,
): Promise<string[]> {
return this.createWritePromise(
Expand Down
43 changes: 19 additions & 24 deletions node/tests/TestUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,15 +799,9 @@ export async function transactionTest(
baseTransaction.set(key1, "bar");
responseData.push(['set(key1, "bar")', "OK"]);
baseTransaction.objectEncoding(key1);
responseData.push([
"objectEncoding(key1)",
decoder == Decoder.String ? "embstr" : Buffer.from("embstr"),
]);
responseData.push(["objectEncoding(key1)", "embstr"]);
baseTransaction.type(key1);
responseData.push([
"type(key1)",
decoder == Decoder.String ? "string" : Buffer.from("string"),
]);
responseData.push(["type(key1)", "string"]);
baseTransaction.echo(value);
responseData.push(["echo(value)", value]);
baseTransaction.persist(key1);
Expand Down Expand Up @@ -897,28 +891,23 @@ export async function transactionTest(
baseTransaction.hrandfield(key4);
responseData.push(["hrandfield(key4)", null]);

baseTransaction.lpush(key5, [
field + "1",
field + "2",
field + "3",
field + "4",
]);
baseTransaction.lpush(key5, [field1, field2, field3, field4]);
responseData.push(["lpush(key5, [1, 2, 3, 4])", 4]);

if (gte("7.0.0", version)) {
baseTransaction.lpush(key24, [field + "1", field + "2"]);
baseTransaction.lpush(key24, [field1, field2]);
responseData.push(["lpush(key22, [1, 2])", 2]);
baseTransaction.lmpop([key24], ListDirection.LEFT);
responseData.push([
"lmpop([key22], ListDirection.LEFT)",
[{ key: key24, elements: [field + "2"] }],
[{ key: key24, elements: [field2] }],
]);
baseTransaction.lpush(key24, [field + "2"]);
baseTransaction.lpush(key24, [field2]);
responseData.push(["lpush(key22, [2])", 2]);
baseTransaction.blmpop([key24], ListDirection.LEFT, 0.1, 1);
responseData.push([
"blmpop([key22], ListDirection.LEFT, 0.1, 1)",
[{ key: key24, elements: [field + "2"] }],
[{ key: key24, elements: [field2] }],
]);
}

Expand Down Expand Up @@ -1230,7 +1219,10 @@ export async function transactionTest(
responseData.push(["zremRangeByLex(key8, -Inf, +Inf)", 0]); // key8 is already empty

if (gte(version, "7.0.0")) {
baseTransaction.zadd(key14, { one: 1.0, two: 2.0 });
baseTransaction.zadd(key14, [
{ element: "one", score: 1.0 },
{ element: "two", score: 2.0 },
]);
responseData.push(["zadd(key14, { one: 1.0, two: 2.0 })", 2]);
baseTransaction.zintercard([key8, key14]);
responseData.push(["zintercard([key8, key14])", 0]);
Expand All @@ -1239,24 +1231,27 @@ export async function transactionTest(
baseTransaction.zmpop([key14], ScoreFilter.MAX);
responseData.push([
"zmpop([key14], MAX)",
[key14, convertRecordToGlideRecord({ two: 2.0 })],
[key14, [{ element: "two", score: 2.0 }]],
]);
baseTransaction.zmpop([key14], ScoreFilter.MAX, 1);
responseData.push([
"zmpop([key14], MAX, 1)",
[key14, convertRecordToGlideRecord({ one: 1.0 })],
[key14, [{ element: "one", score: 1.0 }]],
]);
baseTransaction.zadd(key14, [
{ element: "one", score: 1.0 },
{ element: "two", score: 2.0 },
]);
baseTransaction.zadd(key14, { one: 1.0, two: 2.0 });
responseData.push(["zadd(key14, { one: 1.0, two: 2.0 })", 2]);
baseTransaction.bzmpop([key14], ScoreFilter.MAX, 0.1);
responseData.push([
"bzmpop([key14], ScoreFilter.MAX, 0.1)",
[key14, convertRecordToGlideRecord({ two: 2.0 })],
[key14, [{ element: "two", score: 2.0 }]],
]);
baseTransaction.bzmpop([key14], ScoreFilter.MAX, 0.1, 1);
responseData.push([
"bzmpop([key14], ScoreFilter.MAX, 0.1, 1)",
[key14, convertRecordToGlideRecord({ one: 1.0 })],
[key14, [{ element: "one", score: 1.0 }]],
]);
}

Expand Down

0 comments on commit 02bf43b

Please sign in to comment.