source: trunk/source/tests/ansi-tests/return.lsp @ 8991

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

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

File size: 872 bytes
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Apr 20 16:00:32 2003
4;;;; Contains: Tests of RETURN
5
6(in-package :cl-test)
7
8;;; RETURN is tested extensively in other files
9
10(deftest return.error.1
11  (signals-error (funcall (macro-function 'return)) program-error)
12  t)
13 
14(deftest return.error.2
15  (signals-error (funcall (macro-function 'return) '(return nil))
16                 program-error)
17  t)
18
19(deftest return.error.3
20  (signals-error (funcall (macro-function 'return)
21                          '(return nil) nil nil)
22                 program-error)
23  t)
24
25;;;
26
27(deftest return.1
28  (block nil (return) :bad)
29  nil)
30
31(deftest return.2
32  (block nil (return :good) :bad)
33  :good)
34
35;;; Test that explicit calls to macroexpand in subforms
36;;; are done in the correct environment
37
38(deftest return.3
39  (macrolet
40   ((%m (z) z))
41   (block nil (return (expand-in-current-env (%m :good))) :bad))
42  :good)
Note: See TracBrowser for help on using the repository browser.