(use-modules (redis)
             (srfi srfi-64))

(define conn (redis-connect)) ;; uses env REDIS_PORT

(test-begin "ping")

(test-equal
    "single-command"
    "PONG"
  (redis-send conn (ping)))

(test-equal
    "multiple-commands"
  '("PONG" "hello from guile-redis")
  (redis-send conn (list (ping) (ping '("hello from guile-redis")))))

(define fails (test-runner-fail-count (test-runner-current)))
(test-end "ping")

(redis-close conn)

(exit (if (= fails 0) 0 1))
