X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-introspect%2Ftest-driver.lisp;h=276e4718ed94f93af9eb5e2f5599d1fe46b3fa1d;hb=b2036b630923934234d66247f18acf7a6c1085ec;hp=0a8abaf9e24c9a15b2a28a2757b698f0d958fa2e;hpb=6fd5fc37c44cc49ff0cb587022df4c881683a111;p=sbcl.git diff --git a/contrib/sb-introspect/test-driver.lisp b/contrib/sb-introspect/test-driver.lisp index 0a8abaf..276e471 100644 --- a/contrib/sb-introspect/test-driver.lisp +++ b/contrib/sb-introspect/test-driver.lisp @@ -188,6 +188,14 @@ (not (find-definition-sources-by-name 'fboundp :type)) t) +(deftest find-source-stuff.31 + (matchp-name :function 'cl-user::compile-time-too-fun 28) + t) + +(deftest find-source-stuff.32 + (matchp-name :function 'cl-user::loaded-as-source-fun 3) + t) + ;;; Check wrt. interplay of generic functions and their methods. (defgeneric xuuq (gf.a gf.b &rest gf.rest &key gf.k-X)) @@ -378,12 +386,10 @@ (deftest function-type.2 (values (type-equal (function-type 'sun) (function-type #'sun)) - ;; Does not currently work due to Bug #384892. (1.0.31.26) - #+nil (type-equal (function-type #'sun) '(function (fixnum fixnum &key (:k1 (member nil t))) (values (member t) &optional)))) - t #+nil t) + t t) ;; Local functions @@ -516,7 +522,7 @@ '(function ((member nil t) fixnum fixnum &key (:k1 (member nil t))) - *))) + (values (member nil t) &optional)))) t t) ;; Misc @@ -526,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)