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

« back to all changes in this revision

Viewing changes to ansi-tests/check-type.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:  Sat Feb 15 20:12:04 2003
 
4
;;;; Contains: Tests of CHECK-TYPE
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(deftest check-type.1
 
9
  (let ((x 'a))
 
10
    (values (check-type x symbol) x))
 
11
  nil a)
 
12
 
 
13
(deftest check-type.2
 
14
  (signals-error
 
15
   (let ((x 'a))
 
16
     (check-type x integer))
 
17
   type-error)
 
18
  t)
 
19
 
 
20
(deftest check-type.3
 
21
  (let ((x 'a))
 
22
    (handler-bind
 
23
     ((type-error #'(lambda (c) (store-value 15 c))))
 
24
     (values (check-type x number) x)))
 
25
  nil 15)
 
26
 
 
27
(deftest check-type.4
 
28
  (let ((x 'a))
 
29
    (values (check-type x symbol "a symbol") x))
 
30
  nil a)
 
31
 
 
32
(deftest check-type.5
 
33
  (let ((x 'a))
 
34
    (handler-bind
 
35
     ((type-error #'(lambda (c) (store-value "abc" c))))
 
36
     (values (check-type x string "a string") x)))
 
37
  nil "abc")
 
38
 
 
39
(deftest check-type.6
 
40
  (let ((x 'a))
 
41
    (handler-bind
 
42
     ((type-error #'(lambda (c) (declare (ignore c)) (store-value 15 nil))))
 
43
     (values (check-type x number) x)))
 
44
  nil 15)
 
45
 
 
46
(deftest check-type.7
 
47
  (let ((x 'a))
 
48
    (handler-bind
 
49
     ((type-error #'(lambda (c) (declare (ignore c)) (store-value 15))))
 
50
     (values (check-type x number) x)))
 
51
  nil 15)
 
52