;; -*-theme-d-*-

;; Copyright (C) 2014  Tommi Höynälänmaa
;; Distributed under GNU General Public License version 3,
;; see file doc/GPL-3.

(define-interface (tests numerical-test-env)

  (import (standard-library core)
	  (standard-library math))

  (declare do-report-test
	   (:simple-proc (<object> <number> <number>) <none> nonpure))

  (declare do-report-boolean-test
	   (:simple-proc (<object> <boolean> <boolean>) <none> nonpure))

  (declare do-report-result
	   (:simple-proc (<object> <object>) <none> nonpure))

  (define-syntax report-test
    (syntax-rules ()
      ((_ test nr-correct)
       (do-report-test (quote test) test nr-correct))))

  (define-syntax report-boolean-test
    (syntax-rules ()
      ((_ test b-correct)
       (do-report-boolean-test (quote test) test b-correct))))

  (define-syntax report-result
    (syntax-rules ()
      ((_ expr)
       (do-report-result (quote expr) expr)))))
