Commits

Nikhil Marathe committed 1daaa19

Added more test cases

Comments (0)

Files changed (1)

 (load "redis.lsp")
 (setf conn (redis))
 
+(if (nil? conn)
+  (throw-error "Could not connect to Redis!")
+  true)
+
 (assert-equals (:select conn 14) "OK")
 
 ;; If you have authentication enabled
 (assert-equals (:ping conn) "PONG")
 (assert-equals (:bgsave conn) "Background saving started")
 
-(assert (true? (:get conn "minestrone:song:8412c5ea08987a59ca7e1a9e0651cdb4af4bfe9f")))
+(println "Database size is " (:dbsize conn))
 
-(println "Database size is " (:dbsize conn))
+(println "Keys are " (:keys conn "*"))
+
+(println "Set abcd to 42 => " (:set conn "abcd" 42))
+(println "INCR abcd => " (:incr conn "abcd"))
+(println "INCRBY 5 => " (:incrby conn "abcd" 5))
+
+(dolist (x (:keys conn "*"))
+  (println x " --> " (:get conn x)))
 
 (:close conn)