Last active
December 14, 2015 18:46
-
-
Save rebcabin/0c550e2373f4f7e3f65c to your computer and use it in GitHub Desktop.
gensymming functions versus lisp-unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defpackage :io.github.rebcabin.temporary | |
| (:use :common-lisp) | |
| (:use :lisp-unit) | |
| #+sbcl (:use :sb-ext)) | |
| (in-package :io.github.rebcabin.temporary) | |
| ;;; I can definitely define a function with a gensymmed name: | |
| (defmacro m1 () | |
| (let ((g (gensym))) | |
| `(progn | |
| (defun ,g () | |
| (format t "my name is ~A~%" ',g)) | |
| (,g)))) | |
| (m1) | |
| ;;; I can definitely run tests via lisp-unit: | |
| (define-test dt | |
| (assert-true t)) | |
| ;;; I can definitely NOT define a test using a gensymmed name. This compiles, | |
| ;;; but the test does not run. | |
| (defmacro m2 () | |
| (let ((g (gensym))) | |
| `(progn | |
| (define-test ,g | |
| (format t "my name is ~A~%" ',g)) | |
| ))) | |
| (m2) | |
| (setf *print-failures* t) | |
| (run-tests :all) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try to run this file by just loading it in a session with SBCL.