From 51c69cac8bb4414bea8a82e5ed5ae8a892e30761 Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Mon, 17 Jul 2017 08:32:18 -0400 Subject: [PATCH] Don't name test-generator the same as the function being exercised by it. --- tests/deprecation.impure.lisp | 16 ++++++++-------- tests/deprecation.internal.impure.lisp | 30 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/deprecation.impure.lisp b/tests/deprecation.impure.lisp index f6c7e7460..c7fff2890 100644 --- a/tests/deprecation.impure.lisp +++ b/tests/deprecation.impure.lisp @@ -14,7 +14,7 @@ ;;;; Helpers -(defun check-deprecated-thing (namespace name state make-body +(defun test (namespace name state make-body &key replacements (call t) (expected-warning-count '(eql 1)) @@ -132,20 +132,20 @@ :replacement ,replacement))) (with-test (:name (deprecated variable ,tag ,state)) - (check-deprecated-thing + (test 'variable ',variable-name ,state (lambda (name) `(,name)) :replacements '(,(string replacement)) :call ,call :check-describe ,check-describe) ,@(when symbol-value - `((check-deprecated-thing + `((test 'variable ',variable-name ,state (lambda (name) `((symbol-value ',name))) :replacements '(,(string replacement)) :call ,call :check-describe ,check-describe) - (check-deprecated-thing + (test 'variable ',variable-name ,state (lambda (name) `((symbol-global-value ',name))) :replacements '(,(string replacement)) @@ -195,7 +195,7 @@ :replacement ,replacement))) (with-test (:name (deprecated function ,tag ,state)) - (check-deprecated-thing + (test 'function ',function-name ,state (lambda (name) `((,name))) :replacements '(,(string replacement)) @@ -249,7 +249,7 @@ (test-util:with-test (:name (deprecated type ,@(sb-int:ensure-list tag) ,state)) - (check-deprecated-thing + (test 'type ',type-name ,state (lambda (name) `((let ((x)) @@ -285,14 +285,14 @@ (deftype ,name () 'integer) (declaim (deprecated :early ("some-lib" "1.2.3") (type ,name))))) ;; Make sure the deprecation declaration works. - (check-deprecated-thing + (test 'type name :early (lambda (name) `((typep 1 ',name))) :call nil) ;; Check that the declaration does not apply to an unrelated class ;; of the same name. - (check-deprecated-thing + (test 'type name :early (lambda (name) `((make-instance ,(make-instance 'standard-class :name name)))) diff --git a/tests/deprecation.internal.impure.lisp b/tests/deprecation.internal.impure.lisp index fa68802ac..6399ddcc0 100644 --- a/tests/deprecation.internal.impure.lisp +++ b/tests/deprecation.internal.impure.lisp @@ -14,7 +14,7 @@ ;;;; Helpers -(defun check-deprecated-thing (kind name state make-body +(defun test (kind name state make-body &key (replacements (list (format nil "~A.~A" name '#:replacement)))) @@ -61,11 +61,11 @@ :replacement deprecated-variable.early.replacement) (with-test (:name (sb-int:define-deprecated-variable :early)) - (check-deprecated-thing 'variable 'deprecated-variable.early :early + (test 'variable 'deprecated-variable.early :early (lambda (name) `(,name))) - (check-deprecated-thing 'variable 'deprecated-variable.early :early + (test 'variable 'deprecated-variable.early :early (lambda (name) `((symbol-value ',name)))) - (check-deprecated-thing 'variable 'deprecated-variable.early :early + (test 'variable 'deprecated-variable.early :early (lambda (name) `((symbol-global-value ',name))))) (sb-int:define-deprecated-variable :late "1.2.10" @@ -74,11 +74,11 @@ :replacement deprecated-variable.late.replacement) (with-test (:name (sb-int:define-deprecated-variable :late)) - (check-deprecated-thing 'variable 'deprecated-variable.late :late + (test 'variable 'deprecated-variable.late :late (lambda (name) `(,name))) - (check-deprecated-thing 'variable 'deprecated-variable.late :late + (test 'variable 'deprecated-variable.late :late (lambda (name) `((symbol-value ',name)))) - (check-deprecated-thing 'variable 'deprecated-variable.late :late + (test 'variable 'deprecated-variable.late :late (lambda (name) `((symbol-global-value ',name))))) (sb-int:define-deprecated-variable :final "1.2.10" @@ -87,11 +87,11 @@ :replacement deprecated-variable.final.replacement) (with-test (:name (sb-int:define-deprecated-variable :final)) - (check-deprecated-thing 'variable 'deprecated-variable.final :final + (test 'variable 'deprecated-variable.final :final (lambda (name) `(,name))) - (check-deprecated-thing 'variable 'deprecated-variable.final :final + (test 'variable 'deprecated-variable.final :final (lambda (name) `((symbol-value ',name)))) - (check-deprecated-thing 'variable 'deprecated-variable.final :final + (test 'variable 'deprecated-variable.final :final (lambda (name) `((symbol-global-value ',name))))) @@ -102,7 +102,7 @@ :deprecated) (with-test (:name (sb-int:define-deprecated-function :early)) - (check-deprecated-thing 'function 'deprecated-function.early :early + (test 'function 'deprecated-function.early :early (lambda (name) `((,name))))) (sb-int:define-deprecated-function :late "1.2.10" @@ -110,7 +110,7 @@ :deprecated) (with-test (:name (sb-int:define-deprecated-function :late)) - (check-deprecated-thing 'function 'deprecated-function.late :late + (test 'function 'deprecated-function.late :late (lambda (name) `((,name))))) (sb-int:define-deprecated-function :final "1.2.10" @@ -118,7 +118,7 @@ :deprecated) (with-test (:name (sb-int:define-deprecated-function :final)) - (check-deprecated-thing 'function 'deprecated-function.final :final + (test 'function 'deprecated-function.final :final (lambda (name) `((,name))))) (sb-int:define-deprecated-function :early "1.2.10" @@ -129,7 +129,7 @@ :deprecated) (with-test (:name (sb-int:define-deprecated-function :two-replacements)) - (check-deprecated-thing + (test 'function 'deprecated-function.two-replacements :early (lambda (name) `((,name))) :replacements '("DEPRECATED-FUNCTION.TWO-REPLACEMENTS.REPLACEMENT1" @@ -144,7 +144,7 @@ :deprecated) (with-test (:name (sb-int:define-deprecated-function :three-replacements)) - (check-deprecated-thing + (test 'function 'deprecated-function.three-replacements :early (lambda (name) `((,name))) :replacements '("DEPRECATED-FUNCTION.THREE-REPLACEMENTS.REPLACEMENT1" -- 2.11.4.GIT