mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-14 00:42:44 +00:00
27 lines
375 B
Go
27 lines
375 B
Go
|
package goredis
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestEcho(t *testing.T) {
|
||
|
msg := "message"
|
||
|
if ret, err := r.Echo(msg); err != nil {
|
||
|
t.Error(err)
|
||
|
} else if ret != msg {
|
||
|
t.Errorf("echo %s\n%s", msg, ret)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestPing(t *testing.T) {
|
||
|
if err := r.Ping(); err != nil {
|
||
|
t.Error(err)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func BenchmarkPing(b *testing.B) {
|
||
|
for i := 0; i < b.N; i++ {
|
||
|
r.Ping()
|
||
|
}
|
||
|
}
|