X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fbackq.impure.lisp;h=7632c78d460801dd53ee95b4cc4767bcd53f0f23;hb=9c9d6dbdc28a8bfe70be09f35263e9ec02411d0e;hp=65583f593c72300d99ea1bea84abf5bba09c8875;hpb=83acd60c82635c4a1a3ffe5f0b2a3bbb6a2cce99;p=sbcl.git diff --git a/tests/backq.impure.lisp b/tests/backq.impure.lisp index 65583f5..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) @@ -52,15 +52,22 @@ ("``(,@,@*QQ*)" . (3 5 4 6)))) (mapc (lambda (test) - (test-double-backquote (car test) (cdr test))) + (test-double-backquote (car test) (cdr test))) *backquote-tests*) (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)))) -;;; success -(quit :unix-status 104) +(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)))))