#lang scheme/base

 (file "test.ss")
 (file "util.ss"))

(provide util-tests)

;; FIXME: Two problems
;; 1 - This is not the way to test require/expose: if this fails, it
;;     prevents the tests from loading.
;; 2 - For whatever reason, it *does* fail when loaded via PLaneT.
;;     Still waiting for resolution on a bug report.
(require/expose "check-test.ss" (make-failure-test))

(define util-tests
   "Util tests"
    "make-failure-test required from check-test.ss"
      (check-true (procedure? make-failure-test))
      (check-equal? (make-arity-at-least 2)
                    (procedure-arity make-failure-test))
      (check-pred schemeunit-test-case?
                  (delay-test (make-failure-test "foo" string?)))))
    "Test test-suite*"
    (let ((result
             "Test test-suite*"
             ("Test 1" (check = 1 1))
             ("Test 2" (check = 1 1) (check = 2 4))))))
      (check = (length result) 2)
      (check-true (test-success? (car result)))
      (check-true (test-failure? (cadr result)))))
    "Simple check-regexp test"
    (check-regexp-match "a*bba"
    "check-regexp-match failure"
     (lambda ()
       (check-regexp-match "a+bba" "aaaabbba"))))