Skip to content

Commit

Permalink
Merge branch 'master' into hscan-no-values
Browse files Browse the repository at this point in the history
  • Loading branch information
ofekshenawa authored Jun 19, 2024
2 parents 3da20be + 2a3de7e commit 975c6b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ build:

testdata/redis:
mkdir -p $@
wget -qO- https://download.redis.io/releases/redis-7.2.1.tar.gz | tar xvz --strip-components=1 -C $@
wget -qO- https://download.redis.io/releases/redis-7.4-rc1.tar.gz | tar xvz --strip-components=1 -C $@

testdata/redis/src/redis-server: testdata/redis
cd $< && make all
Expand Down
3 changes: 3 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -4997,6 +4997,7 @@ type ClientInfo struct {
PSub int // number of pattern matching subscriptions
SSub int // redis version 7.0.3, number of shard channel subscriptions
Multi int // number of commands in a MULTI/EXEC context
Watch int // redis version 7.4 RC1, number of keys this client is currently watching.
QueryBuf int // qbuf, query buffer length (0 means no query pending)
QueryBufFree int // qbuf-free, free space of the query buffer (0 means the buffer is full)
ArgvMem int // incomplete arguments for the next command (already extracted from query buffer)
Expand Down Expand Up @@ -5149,6 +5150,8 @@ func parseClientInfo(txt string) (info *ClientInfo, err error) {
info.SSub, err = strconv.Atoi(val)
case "multi":
info.Multi, err = strconv.Atoi(val)
case "watch":
info.Watch, err = strconv.Atoi(val)
case "qbuf":
info.QueryBuf, err = strconv.Atoi(val)
case "qbuf-free":
Expand Down
6 changes: 3 additions & 3 deletions json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,18 @@ var _ = Describe("JSON Commands", Label("json"), func() {
Expect(cmd.Val()).To(Equal("OK"))
})

It("should JSONGet", Label("json.get", "json"), func() {
It("should JSONGet", Label("json.get", "json", "NonRedisEnterprise"), func() {
res, err := client.JSONSet(ctx, "get3", "$", `{"a": 1, "b": 2}`).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res).To(Equal("OK"))

res, err = client.JSONGetWithArgs(ctx, "get3", &redis.JSONGetArgs{Indent: "-"}).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res).To(Equal(`[-{--"a":1,--"b":2-}]`))
Expect(res).To(Equal(`{-"a":1,-"b":2}`))

res, err = client.JSONGetWithArgs(ctx, "get3", &redis.JSONGetArgs{Indent: "-", Newline: `~`, Space: `!`}).Result()
Expect(err).NotTo(HaveOccurred())
Expect(res).To(Equal(`[~-{~--"a":!1,~--"b":!2~-}~]`))
Expect(res).To(Equal(`{~-"a":!1,~-"b":!2~}`))
})

It("should JSONMerge", Label("json.merge", "json"), func() {
Expand Down

0 comments on commit 975c6b5

Please sign in to comment.