Contents

unit-test - Simple unit testing

This module exports syntax to do unit testing.

Synopsis

 >(require (planet "unit-test.scm" ("oesterholt" "ho-utils.plt" 1 0)))
 >(define CONNSTR (if (eq? (getenv "CONNSTR") #f)
                     #f
                     (getenv "CONNSTR")))
 >
 >(unit-tests
   ("connstr"          (lambda () (if (eq? CONNSTR #f)
                                      "Environment variable CONNSTR must be set to a valid PostgreSQL connection string"
                                      #t)))
   ("basic connection" (lambda () (let ((sqld (sqld-psql-new CONNSTR)))
                                    (let ((sqli (sqli-connect sqld)))
                                      (if (or (eq? sqli #f) (sqli-error? sqli))
                                          (sqli-error-message sqli)
                                         #t)))))
   )
  1 - connstr                                 :Environment variable CONNSTR must be set to a valid PostgreSQL connection string
  2 - basic connection                        :exception: Function 'PQconnectdb' has not been loaded

 >

Info

(c) 2007 Hans Oesterholt-Dijkema. Distributed under LGPL.
Contact: send email to hans in domain elemental-programming.org.
Homepage: http://www.elemental-programming.org.