From c5fb0e58a881ccc065214ed3fe794b18706736ca Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 10 Jun 2011 13:22:26 +0300 Subject: [PATCH] sb-introspect: test-cases for defstruct copier, predicate, and accessor sources Feh. There were tests for even the cases that have worked for quite a while now. --- contrib/sb-introspect/test-driver.lisp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/contrib/sb-introspect/test-driver.lisp b/contrib/sb-introspect/test-driver.lisp index a444769..276e471 100644 --- a/contrib/sb-introspect/test-driver.lisp +++ b/contrib/sb-introspect/test-driver.lisp @@ -532,3 +532,33 @@ (type-equal (function-type #'nullary) '(function () (values null &optional)))) t) + +;;; Defstruct accessor, copier, and predicate + +(deftest defstruct-fun-sources + (let ((copier (find-definition-source #'cl-user::copy-three)) + (accessor (find-definition-source #'cl-user::three-four)) + (predicate (find-definition-source #'cl-user::three-p))) + (values (and (equalp copier accessor) + (equalp copier predicate)) + (equal "test.lisp" + (file-namestring (definition-source-pathname copier))) + (equal '(5) + (definition-source-form-path copier)))) + t + t + t) + +(deftest defstruct-fun-sources-by-name + (let ((copier (car (find-definition-sources-by-name 'cl-user::copy-three :function))) + (accessor (car (find-definition-sources-by-name 'cl-user::three-four :function))) + (predicate (car (find-definition-sources-by-name 'cl-user::three-p :function)))) + (values (and (equalp copier accessor) + (equalp copier predicate)) + (equal "test.lisp" + (file-namestring (definition-source-pathname copier))) + (equal '(5) + (definition-source-form-path copier)))) + t + t + t) -- 1.7.10.4