From 4ade7d8df5662651c8eb421b9ba6ac96d9260e28 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 25 Nov 2023 15:44:18 -0800 Subject: examples --- examples/examples.lisp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/examples.lisp b/examples/examples.lisp index 99ad26e..4088d32 100644 --- a/examples/examples.lisp +++ b/examples/examples.lisp @@ -56,10 +56,6 @@ tests that aren't part of the package you're testing." ;;; Stubbing functions with :WITH-DEFUNS -(defun dummy::make-drakma-request (url) - "Assume this actually makes an HTTP request using drakma" - ) - (defun test-count-words-in-response () (assert (= 3 (count-words-in-response "blah")))) @@ -67,14 +63,14 @@ tests that aren't part of the package you're testing." "Fetches a url and counts the words in the response." #+testiere (:tests - (:with-defuns - ((dummy::make-drakma-request (url) - (declare (values (simple-array character))) - "Hello there dudes")) + ;; here we stub a fictitious make-drakma-request function + (:with-defuns ((dummy::make-drakma-request (url) + (declare (ignore url)) + "Hello there dudes")) (= 3 (count-words-in-response "dummy-url")) (:funcall 'test-count-words-in-response))) (loop - :with resp string := (dummy::make-drakma-request url) + :with resp := (dummy::make-drakma-request url) :with in-word? := nil :for char :across resp :when (and in-word? (not (alphanumericp char))) -- cgit v1.2.3