From ad6b09575ce7651f3047f6f88d3041a79d7d4c00 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Thu, 16 Apr 2009 08:32:38 +0200 Subject: [PATCH] Unit-testing for data structures and numerics cleaned up. Signed-off-by: AJ Rossini --- lispstat.asd | 3 +- src/unittests/unittests-arrays.lisp | 3 +- src/unittests/unittests-listoflist.lisp | 50 +++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 src/unittests/unittests-listoflist.lisp diff --git a/lispstat.asd b/lispstat.asd index 7eb77f0..a229eb4 100644 --- a/lispstat.asd +++ b/lispstat.asd @@ -1,5 +1,5 @@ ;; -*- mode: lisp -*- -;;; Time-stamp: <2009-04-02 15:37:56 tony> +;;; Time-stamp: <2009-04-15 08:50:46 tony> ;;; Created: <2005-05-30 17:09:47 blindglobe> ;;; File: lispstat.asd ;;; Author: AJ Rossini @@ -304,5 +304,6 @@ (:file "unittests-prob" :depends-on ("unittests")) (:file "unittests-proto" :depends-on ("unittests")) (:file "unittests-regression" :depends-on ("unittests")) + (:file "unittests-listoflist" :depends-on ("unittests")) (:file "unittests-arrays" :depends-on ("unittests")) (:file "unittests-dataframe" :depends-on ("unittests")))))) diff --git a/src/unittests/unittests-arrays.lisp b/src/unittests/unittests-arrays.lisp index b8c9604..0ef00d8 100644 --- a/src/unittests/unittests-arrays.lisp +++ b/src/unittests/unittests-arrays.lisp @@ -10,7 +10,8 @@ (in-package :lisp-stat-unittests) -;;; TEST for Arrays and Linear Algebra. +;;; TEST for Matrices and Linear Algebra. Should provide additional +;;; tests for lisp-matrix integration. (deftestsuite lisp-stat-ut-array (lisp-stat-ut) ()) diff --git a/src/unittests/unittests-listoflist.lisp b/src/unittests/unittests-listoflist.lisp new file mode 100644 index 0000000..b663fa6 --- /dev/null +++ b/src/unittests/unittests-listoflist.lisp @@ -0,0 +1,50 @@ +;;; -*- mode: lisp -*- + +;;; Time-stamp: <2009-04-15 08:53:25 tony> +;;; Creation: <2009-04-15 08:43:02 tony> +;;; File: unittests-listoflist.lisp +;;; Author: AJ Rossini +;;; Copyright: (c)2009--, AJ Rossini. BSD, LLGPL, or GPLv2, depending +;;; on how it arrives. +;;; Purpose: unittests for the listoflist handling. + + +;;; What is this talk of 'release'? Klingons do not make software +;;; 'releases'. Our software 'escapes', leaving a bloody trail of +;;; designers and quality assurance people in its wake. + +(in-package :lisp-stat-unittests) + +(deftestsuite lisp-stat-ut-listoflist (lisp-stat-ut) + ((my-df-1 + (make-instance 'dataframe-array + :storage #2A((1d0 2d0 3d0 4d0) + (10d0 20d0 30d0 40d0)) + :doc "This is an interesting legal dataframe-array" + :case-labels (list "x" "y") + :var-labels (list "a" "b" "c" "d" "e"))) + (my-matlike-1 + (make-matrix 2 4 + :initial-element 0d0)) + (my-lol-1 '((0d0 1d0 2d0 3d0) + (10d0 11d0 12d0 13d0))))) + + +;;; Listoflist tests + +(addtest (lisp-stat-ut-listoflist) lol-equalp + (ensure + (equalp (dataset (make-instance 'dataframe-array + :storage #2A(('a 'b) + ('c 'd)))) + #2A(('a 'b) + ('c 'd))))) + +(addtest (lisp-stat-ut-listoflist) lol-consdata + (ensure + (consistent-dataframe-p my-df-1))) + + +;;; +;; (run-tests) +;; (describe (run-tests)) -- 2.11.4.GIT