@@ -716,7 +716,7 @@ func testAdapter(resp3 bool) {
716716 // if too much time (>1s) is used during command execution, it may also cause the test to fail.
717717 // so the ObjectIdleTime result should be <=now-start+1s
718718 // link: https://github.com/redis/redis/blob/5b48d900498c85bbf4772c1d466c214439888115/src/object.c#L1265-L1272
719- Expect (idleTime .Val ()).To (BeNumerically ("<=" , time .Now (). Sub (start )+ time .Second ))
719+ Expect (idleTime .Val ()).To (BeNumerically ("<=" , time .Since (start )+ time .Second ))
720720 })
721721
722722 It ("should Persist" , func () {
@@ -7906,6 +7906,28 @@ func testAdapterCache(resp3 bool) {
79067906 Expect (get .Val ()).To (Equal ("hello" ))
79077907 })
79087908
7909+ It ("should MGet" , func () {
7910+ mGet := adapter .Cache (time .Hour ).MGet (ctx , "_" , "key2" )
7911+ Expect (mGet .Err ()).NotTo (HaveOccurred ())
7912+ Expect (mGet .Val ()).To (Equal ([]any {nil , nil }))
7913+
7914+ set := adapter .Set (ctx , "key1" , "hello1" , 0 )
7915+ Expect (set .Err ()).NotTo (HaveOccurred ())
7916+ Expect (set .Val ()).To (Equal ("OK" ))
7917+
7918+ set = adapter .Set (ctx , "key2" , "hello2" , 0 )
7919+ Expect (set .Err ()).NotTo (HaveOccurred ())
7920+ Expect (set .Val ()).To (Equal ("OK" ))
7921+
7922+ mGet = adapter .Cache (time .Hour ).MGet (ctx , "key1" , "key2" , "_" )
7923+ Expect (mGet .Err ()).NotTo (HaveOccurred ())
7924+ Expect (mGet .Val ()).To (Equal ([]any {"hello1" , "hello2" , nil }))
7925+
7926+ mGet = adapter .Cache (time .Hour ).MGet (ctx , "key1" , "_" , "key2" )
7927+ Expect (mGet .Err ()).NotTo (HaveOccurred ())
7928+ Expect (mGet .Val ()).To (Equal ([]any {"hello1" , nil , "hello2" }))
7929+ })
7930+
79097931 It ("should GetBit" , func () {
79107932 setBit := adapter .SetBit (ctx , "key" , 7 , 1 )
79117933 Expect (setBit .Err ()).NotTo (HaveOccurred ())
0 commit comments