source: trunk/source/tests/ansi-tests/keywordp.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: 1.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Jun 14 05:46:51 2003
4;;;; Contains: Tests of KEYWORDP
5
6(in-package :cl-test)
7
8
9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10;;; keywordp
11
12(deftest keywordp.1 (keywordp 'hefalump)   nil)
13(deftest keywordp.2 (keywordp 17)          nil)
14(deftest keywordp.3 (notnot-mv (keywordp :stream))         t)
15(deftest keywordp.4 (notnot-mv (keywordp ':stream))        t)
16(deftest keywordp.5 (keywordp nil)         nil)
17(deftest keywordp.6 (notnot-mv (keywordp :nil))          t)
18(deftest keywordp.7 (keywordp '(:stream))    nil)
19(deftest keywordp.8 (keywordp "rest")     nil)
20(deftest keywordp.9 (keywordp ":rest")    nil)
21(deftest keywordp.10 (keywordp '&body) nil)
22;;; This next test was busted.  ::foo is not portable syntax
23;;(deftest keywordp.11 (notnot-mv (keywordp ::foo))       t)
24(deftest keywordp.12 (keywordp t)          nil)
25
26(deftest keywordp.13
27  (let ((kwp (find-package "KEYWORD"))
28        (bad nil))
29    (do-symbols (s "KEYWORD" bad)
30      (when (and (not (eq (symbol-package s) kwp))
31                 (keywordp s))
32        (push s bad))))
33  nil)
34
35(deftest keywordp.order.1
36  (let ((i 0))
37    (values (keywordp (progn (incf i) nil)) i))
38  nil 1)
39
40(deftest keywordp.error.1 (signals-error (keywordp) program-error) t)
41(deftest keywordp.error.2 (signals-error (keywordp :x :x) program-error) t)
Note: See TracBrowser for help on using the repository browser.