X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fsmoke.impure.lisp;h=a7130a7bca92ed04585341859b4f001f5c673ac0;hb=69ef68ba7393e3492c1b4a756d1140f71c2922bc;hp=87c96debf854ec5a193fec5a9aff25b00aaf4010;hpb=ca379afc74fe525fd70035546d066de5f5ec874d;p=sbcl.git diff --git a/tests/smoke.impure.lisp b/tests/smoke.impure.lisp index 87c96de..a7130a7 100644 --- a/tests/smoke.impure.lisp +++ b/tests/smoke.impure.lisp @@ -15,19 +15,62 @@ (cl:in-package :cl-user) ;;; ROOM should run without signalling an error. (bug 247) -#+nil (room) -#+nil (room t) -#+nil (room nil) - -;;; DESCRIBE should run without signalling an error. -(defstruct to-be-described a b) -(describe (make-to-be-described)) -(describe 12) -(describe "a string") -(describe 'symbolism) -(describe (find-package :cl)) -(describe '(a list)) -(describe #(a vector)) +(room) +(room t) +(room nil) + +;;; COPY-SYMBOL should work without signalling an error, even if the +;;; symbol is unbound. +(copy-symbol 'foo) +(copy-symbol 'bar t) +(defvar *baz* nil) +(copy-symbol '*baz* t) + +;;; SETQ should return its value. +(assert (typep (setq *baz* 1) 'integer)) +(assert (typep (in-package :cl-user) 'package)) + +;;; PROFILE should run without obvious breakage +(progn + (defun profiled-fun () + (random 1d0)) + (profile profiled-fun) + (loop repeat 100000 do (profiled-fun)) + (report)) + +;;; Defconstant should behave as the documentation specifies, +;;; including documented condition type. +(defun oidentity (x) x) +(defconstant +const+ 1) +(assert (= (oidentity +const+) 1)) +(let ((error (nth-value 1 (ignore-errors (defconstant +const+ 2))))) + (assert (typep error 'sb-ext:defconstant-uneql)) + (assert (= (sb-ext:defconstant-uneql-old-value error) 1)) + (assert (= (sb-ext:defconstant-uneql-new-value error) 2)) + (assert (eql (sb-ext:defconstant-uneql-name error) '+const+))) +(assert (= (oidentity +const+) 1)) +(handler-bind + ((sb-ext:defconstant-uneql + (lambda (c) (abort c)))) + (defconstant +const+ 3)) +(assert (= (oidentity +const+) 1)) +(handler-bind + ((sb-ext:defconstant-uneql + (lambda (c) (continue c)))) + (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)