1 ;;;; miscellaneous tests of LOOP-related stuff
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 (in-package "CL-USER")
16 ;;; The bug reported by Alexei Dejneka on sbcl-devel 2001-09-03
18 (assert (equal (let ((hash (make-hash-table)))
19 (setf (gethash 'key1 hash
) 'val1
)
20 (setf (gethash 'key2 hash
) 'val2
)
21 (sort (loop for key being each hash-key in hash
26 ;;; Bug 81, reported by Wolfhard Buss on cmucl-help 2001-02-14, was
27 ;;; fixed by Alexey Dejneka's patch on sbcl-devel 2001-09-30.
28 (assert (equal '(0.0
1.0 2.0 3.0)
29 (loop with
(a . b
) of-type float
= '(0.0 .
1.0)
30 and
(c . d
) of-type float
= '(2.0 .
3.0)
31 return
(list a b c d
))))
33 ;;; a bug reported and fixed by Alexey Dejneka sbcl-devel 2001-10-05:
34 ;;; The type declarations should apply, hence under Python's
35 ;;; declarations-are-assertions rule, the code should signal a type
37 (assert (typep (nth-value 1
41 of-type float
= '(5 .
5)
42 return
(list a b
))))))
45 ;;; bug 103, reported by Arthur Lemmens sbcl-devel 2001-05-05,
46 ;;; fixed by Alexey Dejneka patch sbcl-devel 2001-10-05:
47 ;;; LOOP syntax requires that forms after INITIALLY, FINALLY, and DO
48 ;;; must be compound forms.
49 (multiple-value-bind (function warnings-p failure-p
)
55 (declare (ignore function warnings-p
))