X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fbackq.impure.lisp;h=7632c78d460801dd53ee95b4cc4767bcd53f0f23;hb=260de2062fca170efdac3e42491d7d866c2d2e56;hp=c9628a943e7a29b548fec96e63aad6c6c00a20b0;hpb=f4f423b699b25a78e70fb990ca3a434f3e2cbba2;p=sbcl.git diff --git a/tests/backq.impure.lisp b/tests/backq.impure.lisp index c9628a9..7632c78 100644 --- a/tests/backq.impure.lisp +++ b/tests/backq.impure.lisp @@ -6,13 +6,13 @@ ;;;; While most of SBCL is derived from the CMU CL system, the test ;;;; files (like this one) were written from scratch after the fork ;;;; from CMU CL. -;;;; +;;;; ;;;; This software is in the public domain and is provided with ;;;; absolutely no warranty. See the COPYING and CREDITS files for ;;;; more information. (in-package "CL-USER") - + (defparameter *qq* '(*rr* *ss*)) (defparameter *rr* '(3 5)) (defparameter *ss* '(4 6)) @@ -33,7 +33,7 @@ value)) (format t "Ok. Look at PPRINTed version: ") (pprint (read-from-string expression))) - + (defparameter *backquote-tests* '(("``(,,*QQ*)" . (24)) ("``(,@,*QQ*)" . 24) @@ -51,9 +51,23 @@ ("``(FOO ,@,@*Q*)" . (foo a b c sqrt 9)) ("``(,@,@*QQ*)" . (3 5 4 6)))) -(mapc #'(lambda (test) - (test-double-backquote (car test) (cdr test))) +(mapc (lambda (test) + (test-double-backquote (car test) (cdr test))) *backquote-tests*) -;;; success -(quit :unix-status 104) +(let ((string "`(foobar a b ,c ,'(e f g) d ,@'(e f g) (h i j) ,@foo)")) + (assert (equal (print (read-from-string string)) (read-from-string string)))) + +(let ((a '`(1 ,@a ,@b ,.c ,.d))) + (let ((*print-circle* t)) + (assert (equal (read-from-string (write-to-string a)) a)))) + +(let ((s '``(,,@(list 1 2 3) 10))) + (assert (equal (eval (eval s)) '(1 2 3 10)))) + +(with-test (:name :comma-at-number-error) + (assert (eq :error + (handler-case + (read-from-string "`(,@1)") + (reader-error () + :error)))))