0.8.21.50:
[sbcl.git] / tests / smoke.impure.lisp
index d5e86b3..a7130a7 100644 (file)
 (assert (typep (in-package :cl-user) 'package))
 
 ;;; PROFILE should run without obvious breakage
-(defun profiled-fun ()
-  (random 1d0))
-(profile profiled-fun)
-(loop repeat 100000 do (profiled-fun))
-(report)
+(progn
+  (defun profiled-fun ()
+    (random 1d0))
+  (profile profiled-fun)
+  (loop repeat 100000 do (profiled-fun))
+  (report))
 
-;;; DEFCONSTANT should behave as the documentation specifies,
+;;; Defconstant should behave as the documentation specifies,
 ;;; including documented condition type.
 (defun oidentity (x) x)
 (defconstant +const+ 1)
   (defconstant +const+ 3))
 (assert (= (oidentity +const+) 3))
 
+;;; MULTIPLE-VALUE-BIND and lambda list keywords
+(multiple-value-bind (&rest &optional &key &allow-other-keys)
+    (values 1 2 3)
+  (assert (= &rest 1))
+  (assert (= &optional 2))
+  (assert (= &key 3))
+  (assert (null &allow-other-keys)))
+
+(let ((fn (lambda (&foo &rest &bar) (cons &foo &bar))))
+  (assert (equal (funcall fn 1) '(1)))
+  (assert (equal (funcall fn 1 2 3) '(1 2 3))))
+
 ;;; success
 (quit :unix-status 104)