Skip to content

Commit

Permalink
test(functional): monitor result compare lowercase more changes - rel…
Browse files Browse the repository at this point in the history
…ated to issue #1671

Signed-off-by: Boaz Sade <boaz@dragonflydb.io>
  • Loading branch information
boazsade committed Nov 6, 2022
1 parent 0add883 commit 44ff5db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions test/functional/monitor.ts
Expand Up @@ -15,7 +15,7 @@ describe("monitor", () => {
return;
}
monitor.on("monitor", function (time, args) {
expect(args[0]).to.eql("get");
expect(args[0]).to.match(/get/i);
expect(args[1]).to.eql("foo");
redis.disconnect();
monitor.disconnect();
Expand Down Expand Up @@ -61,7 +61,7 @@ describe("monitor", () => {
return;
}
monitor.on("monitor", (_time, args) => {
if (args[0] === "set") {
if (args[0] === "set" || args[0] === "SET") {
redis.disconnect();
monitor.disconnect();
done();
Expand Down
6 changes: 2 additions & 4 deletions test/functional/pipeline.ts
Expand Up @@ -323,7 +323,7 @@ describe("pipeline", () => {
redis.disconnect();

expectedCommands.forEach((expectedCommand, j) => {
expectedCommand.forEach((arg, i) => expect(arg).to.eql(commands[j][i]));
expectedCommand.forEach((arg, i) => expect(arg).to.eql(commands[j][i].toLowerCase()));
});
});

Expand Down Expand Up @@ -388,9 +388,7 @@ describe("pipeline", () => {
redis2.disconnect();

const expected = ["set", "eval", "get"];
commands.forEach((c, i) => {
expect(c[0]).to.equal(expected[i]);
});
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expected);
});
});

Expand Down
8 changes: 4 additions & 4 deletions test/functional/scripting.ts
Expand Up @@ -204,7 +204,7 @@ describe("scripting", () => {
});

const expectedComands = ["evalsha", "eval", "get", "evalsha", "get"];
expect(commands.map((c) => c[0])).to.eql(expectedComands);
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
});

it("should load scripts first before execution of pipeline", async () => {
Expand All @@ -230,7 +230,7 @@ describe("scripting", () => {

const expectedComands = ["evalsha", "get", "eval", "set", "get"];

expect(commands.map((c) => c[0])).to.eql(expectedComands);
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
});

it("does not fallback to EVAL in regular transaction", async () => {
Expand Down Expand Up @@ -260,7 +260,7 @@ describe("scripting", () => {
spy.restore();
expect(spy.callCount).to.equal(4);
const expectedComands = ["multi", "evalsha", "evalsha", "exec"];
expect(commands.map((c) => c[0])).to.eql(expectedComands);
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
});

it("does not fallback to EVAL in manual transaction", async () => {
Expand All @@ -284,7 +284,7 @@ describe("scripting", () => {
spy.restore();
expect(spy.callCount).to.equal(4);
const expectedComands = ["multi", "evalsha", "evalsha", "exec"];
expect(commands.map((c) => c[0])).to.eql(expectedComands);
expect(commands.map((c) => c[0].toLowerCase())).to.have.members(expectedComands);
});

it("should support key prefixing", (done) => {
Expand Down

0 comments on commit 44ff5db

Please sign in to comment.