atom.lsp 625 Bytes
Newer Older
1 2 3 4 5 6 7
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Apr 19 21:28:09 2003
;;;; Contains: Tests of ATOM

(in-package :cl-test)

8 9
; (compile-and-load "cons-aux.lsp")

pfdietz's avatar
pfdietz committed
10 11
(deftest atom.1
  (loop for x in *universe*
sds's avatar
sds committed
12 13
        unless (if (atom x) (not (consp x)) (consp x))
        collect x)
pfdietz's avatar
pfdietz committed
14 15 16 17 18 19
  nil)

(deftest atom.2
  (macrolet ((%m (z) z)) (atom (expand-in-current-env (%m 0))))
  t)

20 21 22 23 24 25
(deftest atom.order.1
  (let ((i 0))
    (values (atom (progn (incf i) '(a b))) i))
  nil 1)

(deftest atom.error.1
26 27
  (signals-error (atom) program-error)
  t)
28 29

(deftest atom.error.2
30 31
  (signals-error (atom 'a 'b) program-error)
  t)