source: trunk/source/tests/ansi-tests/remprop.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.7 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Jul 12 18:25:53 2004
4;;;; Contains: Tests for REMPROP
5
6(in-package :cl-test)
7
8(deftest remprop.1
9  (let ((sym (gensym)))
10    (values
11     (symbol-plist sym)
12     (multiple-value-list (remprop sym :foo))
13     (symbol-plist sym)))
14  nil (nil) nil)
15
16(deftest remprop.2
17  (let ((sym (gensym)))
18    (values
19     (symbol-plist sym)
20     (copy-list (setf (symbol-plist sym) '(:foo 0)))
21     (multiple-value-list (notnot-mv (remprop sym :foo)))
22     (symbol-plist sym)))
23  nil (:foo 0) (t) nil)
24
25(deftest remprop.3
26  (let ((sym (gensym)))
27    (values
28     (symbol-plist sym)
29     (copy-list (setf (symbol-plist sym) (list :bar 1 :foo 0 :baz 2)))
30     (multiple-value-list (notnot-mv (remprop sym :foo)))
31     (copy-list (symbol-plist sym))
32     (multiple-value-list (notnot-mv (remprop sym :foo)))
33     (symbol-plist sym)))     
34  nil
35  (:bar 1 :foo 0 :baz 2)
36  (t)
37  (:bar 1 :baz 2)
38  (nil)
39  (:bar 1 :baz 2))
40
41(deftest remprop.4
42  (let ((sym (gensym)))
43    (values
44     (symbol-plist sym)
45     (copy-list (setf (symbol-plist sym) (list :bar 1 :foo 0 :baz 2 :foo 3)))
46     (multiple-value-list (notnot-mv (remprop sym :foo)))
47     (copy-list (symbol-plist sym))
48     (multiple-value-list (notnot-mv (remprop sym :foo)))
49     (symbol-plist sym)))
50  nil
51  (:bar 1 :foo 0 :baz 2 :foo 3)
52  (t)
53  (:bar 1 :baz 2 :foo 3)
54  (t)
55  (:bar 1 :baz 2))
56
57;;; Error tests
58
59(deftest remprop.error.1
60  (signals-error (remprop) program-error)
61  t)
62
63(deftest remprop.error.2
64  (signals-error (remprop (gensym)) program-error)
65  t)
66
67(deftest remprop.error.3
68  (signals-error (remprop (gensym) nil nil) program-error)
69  t)
70
71(deftest remprop.error.4
72  (check-type-error #'(lambda (x) (remprop x nil)) #'symbolp)
73  nil)
Note: See TracBrowser for help on using the repository browser.