~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/muffle-warning.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;-*- Mode:     Lisp -*-
 
2
;;;; Author:   Paul Dietz
 
3
;;;; Created:  Sun Mar 23 08:46:05 2003
 
4
;;;; Contains: Tests of the MUFFLE-WARNING restart and function
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(deftest muffle-warning.1
 
9
  (restart-case
 
10
   (progn (muffle-warning) 'bad)
 
11
   (muffle-warning () 'good))
 
12
  good)
 
13
 
 
14
(deftest muffle-warning.2
 
15
  (let ((c1 (make-condition 'error))
 
16
        (c2 (make-condition 'error)))
 
17
    (restart-case
 
18
     (with-condition-restarts
 
19
      c1
 
20
      (list (first (compute-restarts)))
 
21
      (muffle-warning c2))
 
22
     (muffle-warning () 'bad)
 
23
     (muffle-warning () 'good)))
 
24
  good)
 
25
 
 
26
(deftest muffle-warning.3
 
27
  (restart-case
 
28
   (progn (muffle-warning nil) 'bad)
 
29
   (muffle-warning () 'good))
 
30
  good)
 
31
 
 
32
(deftest muffle-warning.4
 
33
  (let ((c1 (make-condition 'error))
 
34
        (c2 (make-condition 'error)))
 
35
    (restart-case
 
36
     (with-condition-restarts
 
37
      c1
 
38
      (list (first (compute-restarts)))
 
39
      (muffle-warning nil))
 
40
     (muffle-warning () 'good)
 
41
     (muffle-warning () 'bad)))
 
42
  good)
 
43
 
 
44
(deftest muffle-warning.5
 
45
  (signals-error
 
46
   (let ((c1 (make-condition 'error))
 
47
         (c2 (make-condition 'error)))
 
48
     (with-condition-restarts
 
49
      c1
 
50
      (compute-restarts)
 
51
      ;; All conditions are now associated with c1
 
52
      (muffle-warning c2)))
 
53
   control-error)
 
54
  t)
 
55