;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; 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) (defvar *dummy-evaluation-method-descriptor* (make-evaluation-method-descriptor "test" #'(lambda (state) (declare (ignore state)) (values)) #'<)) (deftestsuite evaluation-methods-apps-test-suite (nova-tests) () :dynamic-variables (*evaluation-methods*) :setup (setf *evaluation-methods* (list (cons 'test *dummy-evaluation-method-descriptor*))) :teardown (setf *evaluation-methods* nil)) (addtest check-all-evaluation-method-ids (ensure-same (all-evaluation-method-ids) '(test))) (addtest check-all-evaluation-methods (ensure-same (all-evaluation-methods) (list *dummy-evaluation-method-descriptor*))) (addtest check-lookup-evaluation-method (ensure-same (lookup-evaluation-method 'test) *dummy-evaluation-method-descriptor*)) (addtest check-register-evaluation-method (let ((sym 'test2) (name "test2") (fn #'(lambda () nil)) (cmp-fn #'<)) (ensure-no-warning (register-evaluation-method-by-parameters sym name fn cmp-fn)) (let ((sed (lookup-evaluation-method sym))) (ensure-same (evaluation-method-descriptor-name sed) name) (ensure-same (evaluation-method-descriptor-function sed) fn)))) (addtest check-register-evaluation-method-invalid-function (ensure-error (register-evaluation-method-by-parameters 'invalid-fn "invalid-fn" 'not-a-function #'<)))