source: trunk/source/tests/ansi-tests/with-compilation-unit.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Apr 30 07:36:26 2005
4;;;; Contains: Tests of WITH-COMPILATION-UNIT
5
6;;; WITH-COMPILATION-UNIT doesn't have much in the way of standardized
7;;; semantics, so there's not much to test.
8
9(in-package :cl-test)
10
11(deftest with-compilation-unit.1
12  (with-compilation-unit ())
13  nil)
14
15(deftest with-compilation-unit.2
16  (with-compilation-unit () t)
17  t)
18
19(deftest with-compilation-unit.3
20  (with-compilation-unit () (values)))
21
22(deftest with-compilation-unit.4
23  (with-compilation-unit () (values 1 2 3 4 5))
24  1 2 3 4 5)
25
26(deftest with-compilation-unit.5
27  (with-compilation-unit (:override nil) :foo)
28  :foo)
29 
30(deftest with-compilation-unit.6
31  (with-compilation-unit (:override t) (values 10 17))
32  10 17)
33
34(deftest with-compilation-unit.7
35  (let ((x nil))
36    (values
37     (block done
38       (with-compilation-unit
39        (:override nil)
40        (setq x 1)
41        (return-from done 2)
42        (setq x 2)))
43     x))
44  2 1)
45
46;;; Add a test that (1) checks if the compiler normally delays
47;;; warnings until the end of a file and, if so, (2) checks that
48;;; with-compilation-unit delays the warnings for more than one
49;;; file compilation until the end of the unit.
Note: See TracBrowser for help on using the repository browser.