;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This file is part of "NOVA": NOVA = search + COCOMO tools ; Copyright, 2008, Tim Menzies tim@menzies.us ; ; NOVA is free software: you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, either version 3 of the License, or ; (at your option) any later version. ; ; NOVA is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; You should have received a copy of the GNU General Public License ; a long with NOVA. If not, see . ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :nova-test.apps) (deftestsuite results-cache-apps-test-suite (nova-tests) () :dynamic-variables (*default-result-cache*) :setup (setf *default-result-cache* (make-memory-result-cache)) :teardown (setf *default-result-cache* nil)) (addtest check-store-result-and-retrieve-result-memory-cache (let ((sym 'test) (result (make-result))) (ensure-no-warning (store-result-in-cache *default-result-cache* sym result)) (ensure-no-warning (retrieve-result-from-cache *default-result-cache* sym)) (ensure-same (retrieve-result-from-cache *default-result-cache* sym) result :test #'equalp))) (addtest check-list-ids-in-cache (let ((sym-list '(test1 test2 test3))) (dolist (sym sym-list) (ensure-no-warning (store-result-in-cache *default-result-cache* sym (make-result)))) (ensure-same (list-ids-in-cache *default-result-cache*) sym-list :test #'subset-compare-equalp))) (addtest check-mapcache (let (things-in-cache (sym-list '(test1 test2 test3))) (dolist (sym sym-list) (puta sym (make-result) things-in-cache)) (dolist (sym sym-list) (ensure-no-warning (store-result-in-cache *default-result-cache* sym (geta sym things-in-cache)))) (mapcache *default-result-cache* #'(lambda (id results) (ensure-same results (geta id things-in-cache) :test #'equalp)))))