Skip to content

Commit

Permalink
add go gest (OpenAtomFoundation#2126)
Browse files Browse the repository at this point in the history
Co-authored-by: wuxianrong <[email protected]>
  • Loading branch information
Mixficsol and wuxianrong authored Nov 20, 2023
1 parent 1151e75 commit af22eea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion tests/integration/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/redis/go-redis/v9"
)

var _ = Describe("List Commands", func() {
var _ = Describe("Hash Commands", func() {
ctx := context.TODO()
var client *redis.Client

Expand Down Expand Up @@ -308,6 +308,16 @@ var _ = Describe("List Commands", func() {
Expect(slice).To(Equal([]string{"hello1", "hello2"}))
})

It("should HSTRLEN", func() {
hSet := client.HSet(ctx, "hash", "key1", "hello1")
Expect(hSet.Err()).NotTo(HaveOccurred())

hGet := client.HGet(ctx, "hash", "key1")
Expect(hGet.Err()).NotTo(HaveOccurred())
length := client.Do(ctx, "hstrlen", "hash", "key1")

Expect(length.Val()).To(Equal(int64(len("hello1"))))
})
//It("should HRandField", func() {
// err := client.HSet(ctx, "hash", "key1", "hello1").Err()
// Expect(err).NotTo(HaveOccurred())
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/redis/go-redis/v9"
)

var _ = Describe("List Commands", func() {
var _ = Describe("Set Commands", func() {
ctx := context.TODO()
var client *redis.Client

Expand Down

0 comments on commit af22eea

Please sign in to comment.