Commit 4cba75d6 authored by pfdietz's avatar pfdietz

Add explicit tests for macroexpand, macroexpand-1

parent 1f5063eb
......@@ -19,3 +19,5 @@
(load "dynamic-extent.lsp")
(load "optimize.lsp")
(load "special.lsp")
(load "macroexpand.lsp")
(load "macroexpand-1.lsp")
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat May 28 13:47:32 2005
;;;; Contains: Tests of MACROEXPAND-1
(in-package :cl-test)
(deftest macroexpand-1.error.1
(signals-error (macroexpand-1) program-error)
t)
(deftest macroexpand-1.error.2
(signals-error (macroexpand-1 'x nil nil) program-error)
t)
;;; Non-error tests
(deftest macroexpand-1.1
(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand-1 x) x))
collect (list x (macroexpand-1 x)))
nil)
(deftest macroexpand-1.2
(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand-1 x nil) x))
collect (list x (macroexpand-1 x nil)))
nil)
(deftest macroexpand-1.3
(macrolet ((%m (&environment env)
`(quote
,(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand-1 x env) x))
collect (list x (macroexpand-1 x env))))))
(%m))
nil)
(deftest macroexpand-1.4
(macrolet ((%m () ''foo))
(macrolet ((%m2 (&environment env)
(macroexpand-1 '(%m) env)))
(%m2)))
foo)
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sat May 28 13:43:00 2005
;;;; Contains: Tests of MACROEXPAND
(in-package :cl-test)
(deftest macroexpand.error.1
(signals-error (macroexpand) program-error)
t)
(deftest macroexpand.error.2
(signals-error (macroexpand 'x nil nil) program-error)
t)
;;; Non-error tests
(deftest macroexpand.1
(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand x) x))
collect (list x (macroexpand x)))
nil)
(deftest macroexpand.2
(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand x nil) x))
collect (list x (macroexpand x nil)))
nil)
(deftest macroexpand.3
(macrolet ((%m (&environment env)
`(quote
,(loop for x in *universe*
unless (or (symbolp x)
(consp x)
(eql (macroexpand x env) x))
collect (list x (macroexpand x env))))))
(%m))
nil)
(deftest macroexpand.4
(macrolet ((%m () ''foo))
(macrolet ((%m2 (&environment env)
(macroexpand '(%m) env)))
(%m2)))
foo)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment