Skip to content

Commit

Permalink
keys: add object command test case
Browse files Browse the repository at this point in the history
  • Loading branch information
xuyu committed Jan 12, 2014
1 parent 6825ae0 commit a355030
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@ func TestMove(t *testing.T) {
}
}

func TestObject(t *testing.T) {
r.Del("key")
r.LPush("key", "hello world")
if rp, err := r.Object("refcount", "key"); err != nil {
t.Error(err)
} else if rp.Type != IntegerReply {
t.Fail()
}
if rp, err := r.Object("encoding", "key"); err != nil {
t.Error(err)
} else if rp.Type != BulkReply {
t.Fail()
}
if rp, err := r.Object("idletime", "key"); err != nil {
t.Error(err)
} else if rp.Type != IntegerReply {
t.Fail()
}
}

func TestPersist(t *testing.T) {
r.Set("key", "value", 0, 0, false, false)
r.Expire("key", 500)
Expand Down

0 comments on commit a355030

Please sign in to comment.