55
66. "github.com/bsm/ginkgo/v2"
77. "github.com/bsm/gomega"
8+
89"github.com/redis/go-redis/v9"
910)
1011
@@ -13,7 +14,6 @@ type JSONGetTestStruct struct {
1314}
1415
1516var _ = Describe ("JSON Commands" , Label ("json" ), func () {
16-
1717ctx := context .TODO ()
1818var client * redis.Client
1919
@@ -27,7 +27,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
2727})
2828
2929Describe ("arrays" , Label ("arrays" ), func () {
30-
3130It ("should JSONArrAppend" , Label ("json.arrappend" , "json" ), func () {
3231cmd1 := client .JSONSet (ctx , "append2" , "$" , `{"a": [10], "b": {"a": [12, 13]}}` )
3332Expect (cmd1 .Err ()).NotTo (HaveOccurred ())
@@ -76,7 +75,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
7675res , err = client .JSONArrIndexWithArgs (ctx , "index2" , "$" , & redis.JSONArrIndexArgs {Stop : & stop }, 4 ).Result ()
7776Expect (err ).NotTo (HaveOccurred ())
7877Expect (res [0 ]).To (Equal (int64 (- 1 )))
79-
8078})
8179
8280It ("should JSONArrIndex and JSONArrIndexWithArgs with $" , Label ("json.arrindex" , "json" ), func () {
@@ -235,7 +233,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
235233Expect (cmd3 .Err ()).NotTo (HaveOccurred ())
236234Expect (cmd3 .Val ()).To (Equal ("[[100,200,200]]" ))
237235})
238-
239236})
240237
241238Describe ("get/set" , Label ("getset" ), func () {
@@ -257,7 +254,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
257254res , err = client .JSONGetWithArgs (ctx , "get3" , & redis.JSONGetArgs {Indent : "-" , Newline : `~` , Space : `!` }).Result ()
258255Expect (err ).NotTo (HaveOccurred ())
259256Expect (res ).To (Equal (`[~-{~--"a":!1,~--"b":!2~-}~]` ))
260-
261257})
262258
263259It ("should JSONMerge" , Label ("json.merge" , "json" ), func () {
@@ -330,13 +326,10 @@ var _ = Describe("JSON Commands", Label("json"), func() {
330326iRes , err = client .JSONMGet (ctx , "$..a" , "non_existing_doc" , "non_existing_doc1" ).Result ()
331327Expect (err ).NotTo (HaveOccurred ())
332328Expect (iRes ).To (Equal ([]interface {}{nil , nil }))
333-
334329})
335-
336330})
337331
338332Describe ("Misc" , Label ("misc" ), func () {
339-
340333It ("should JSONClear" , Label ("json.clear" , "json" ), func () {
341334cmd1 := client .JSONSet (ctx , "clear1" , "$" , `[1]` )
342335Expect (cmd1 .Err ()).NotTo (HaveOccurred ())
@@ -460,7 +453,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
460453cmd3 := client .JSONGet (ctx , "forget3" , "$" )
461454Expect (cmd3 .Err ()).NotTo (HaveOccurred ())
462455Expect (cmd3 .Val ()).To (Equal (`[{"b":{"b":"annie"}}]` ))
463-
464456})
465457
466458It ("should JSONForget with $" , Label ("json.forget" , "json" ), func () {
@@ -622,7 +614,6 @@ var _ = Describe("JSON Commands", Label("json"), func() {
622614cmd3 , err := client .JSONGet (ctx , "strapp1" , "$" ).Result ()
623615Expect (err ).NotTo (HaveOccurred ())
624616Expect (cmd3 ).To (Equal (`["foobar"]` ))
625-
626617})
627618
628619It ("should JSONStrAppend and JSONStrLen with $" , Label ("json.strappend" , "json.strlen" , "json" ), func () {
0 commit comments