From 66920f1a25b083c9d62e820215654920be3c1052 Mon Sep 17 00:00:00 2001 From: Zihua Li Date: Wed, 23 Oct 2019 16:13:41 +0800 Subject: [PATCH] test: add case for passwords containing + --- test/unit/redis.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/redis.ts b/test/unit/redis.ts index 7bf96d51..116584de 100644 --- a/test/unit/redis.ts +++ b/test/unit/redis.ts @@ -42,6 +42,14 @@ describe("Redis", function() { expect(option).to.have.property("password", "authpassword"); expect(option).to.have.property("db", 4); + option = getOption("redis://:1+1@127.0.0.1:6380"); + expect(option).to.have.property("password", "1+1"); + + option = getOption( + `redis://127.0.0.1:6380/?password=${encodeURIComponent("1+1")}` + ); + expect(option).to.have.property("password", "1+1"); + option = getOption("redis://127.0.0.1/"); expect(option).to.have.property("db", 0);