@ \subsection{Testing the function module} Following our standard order, we'll setup for tests at the beginning and define tests throughout the implementation of functions. <>= <> <> @ <>= (add-test (make-test-suite "Functions Test Suite" NIL <> ) max-test-suite ) @ This test verifies that the type of functions is a type. <>= (defmethod type-of-functions ((nf nullfix)) (unless (addr-value-equal (typeaddr-instance *types*) (addr-type *functions*) (addr-value *types*)) (failure "Type of *functions* is not *types*") )) @ <>= ("Type of *functions*" 'nullfix :test-thunk 'type-of-functions) @ We have 4 tests to ensure the domain is ``types'' and the codomain is ``functions'' for both the domain and codomain functions. <>= (defmethod domain-domain ((nf nullfix)) (unless (addr-equal (function-apply *domain* *domain*) *functions*) (failure "Domain of the domain function is not *functions*") )) (defmethod domain-codomain ((nf nullfix)) (unless (addr-equal (function-apply *domain* *codomain*) *functions*) (failure "Domain of the codomain function is not *functions*") )) (defmethod codomain-domain ((nf nullfix)) (unless (addr-equal (function-apply *codomain* *domain*) *types*) (failure "Codomain of the domain function is not *types*") )) (defmethod codomain-codomain ((nf nullfix)) (unless (addr-equal (function-apply *codomain* *codomain*) *types*) (failure "Codomain of the codomain function is not *types*") )) @ <>= ("Domain of domain function" 'nullfix :test-thunk 'domain-domain) ("Domain of codomain function" 'nullfix :test-thunk 'domain-codomain) ("Codomain of domain function" 'nullfix :test-thunk 'codomain-domain) ("Codomain of codomain function" 'nullfix :test-thunk 'codomain-codomain)