From c9c532357894e8e9a39fc51cd438db9523cb4f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Wed, 19 Mar 2025 09:44:01 +0100 Subject: [PATCH] tests: add a test for an important corner case In case that someone wants to store the definition when compiling the file, we need to make sure that the compiler does not error if it has unreadable objects. --- src/tests/normal-tests/compiler.lsp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tests/normal-tests/compiler.lsp b/src/tests/normal-tests/compiler.lsp index 4bc2f1d90..93ae0085e 100644 --- a/src/tests/normal-tests/compiler.lsp +++ b/src/tests/normal-tests/compiler.lsp @@ -2528,3 +2528,12 @@ (is (equal (funcall (funcall f0)) '((1 2 3) . 42))) (is (equal (funcall (funcall f1)) '((1 2 3) . 42))) (is (equal (funcall (funcall f2)) '((1 2 3) . 42))))) + +;;; When we compile a file it is sometimes not possible to store all definitions +;;; readably. Make sure that the compiler does not error in such cases. +(deftest cmp.0107.unreadable-definition () + (finishes + (with-compiler ("unreadable-definition.lsp") + '(macrolet ((def-it (name) + `(defun test () ,(find-package name)))) + (def-it "COMMON-LISP")))))