From 496ae5e88c4d9e0329d0b252251bfd07ac8cfa94 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Wed, 12 Mar 2008 17:46:47 +0100 Subject: [PATCH] unittests for the CLOS based statistical data structure. --- unittests-dataclos.lisp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 unittests-dataclos.lisp diff --git a/unittests-dataclos.lisp b/unittests-dataclos.lisp new file mode 100644 index 0000000..a7515ea --- /dev/null +++ b/unittests-dataclos.lisp @@ -0,0 +1,58 @@ +;;; -*- mode: lisp -*- +;;; Copyright (c) 2007, by A.J. Rossini +;;; See COPYRIGHT file for any additional restrictions (BSD license). +;;; Since 1991, ANSI was finally finished. Edited for ANSI Common Lisp. + +;;; This is semi-external to lispstat core packages. The dependency +;;; should be that lispstat packages are dependencies for the unit +;;; tests. However, where they will end up is still to be +;;; determined. + +(in-package :cl-user) + +(defpackage :lisp-stat-unittests-dataclos + (:use :common-lisp :lift :lisp-stat :lisp-stat-unittests) + (:shadowing-import-from :lisp-stat + slot-value call-method call-next-method ;; objects + expt + - * / ** mod rem abs 1+ 1- log exp sqrt sin cos tan ;; lsmath + asin acos atan sinh cosh tanh asinh acosh atanh float random + truncate floor ceiling round minusp zerop plusp evenp oddp + < <= = /= >= > ;; complex + conjugate realpart imagpart phase + min max logand logior logxor lognot ffloor fceiling + ftruncate fround signum cis) + (:export unittest-data)) + +(in-package :lisp-stat-unittests-dataclos) + +;;; TESTS + +(defun run-lisp-stat-tests () + (run-tests :suite 'lisp-stat)) + +(defun run-lisp-stat-test (&rest x) + (run-test x)) + + +(deftestsuite lisp-stat-dataclos (lisp-stat) + () + (:tests + (initdata (ensure-true )))) + + + +(deftestsuite lisp-stat-testsupport (lisp-stat) + () + (:tests + (almost=1 (ensure (almost= 3 3.001 :tol 0.01))) + + + +(addtest (lisp-stat-dataclos) testnameData + (ensure-same + (dataset (list a b c d) :form (list 2 2)) + #2A((a b) (c d)) + :test 'eql)) + + + \ No newline at end of file -- 2.11.4.GIT