Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Karsten Poeck
ansi-test
Commits
df8787ef
Commit
df8787ef
authored
Jun 04, 2005
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for MACRO-FUNCTION
parent
afc28140
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
0 deletions
+99
-0
ansi-tests/load-eval-and-compile.lsp
ansi-tests/load-eval-and-compile.lsp
+1
-0
ansi-tests/macro-function.lsp
ansi-tests/macro-function.lsp
+98
-0
No files found.
ansi-tests/load-eval-and-compile.lsp
View file @
df8787ef
...
...
@@ -23,3 +23,4 @@
(load "macroexpand-1.lsp")
(load "declaration.lsp")
(load "type.lsp")
(load "macro-function.lsp")
ansi-tests/macro-function.lsp
0 → 100644
View file @
df8787ef
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Fri Jun 3 22:17:34 2005
;;;; Contains: Tests of MACRO-FUNCTION
(in-package :cl-test)
(deftest macro-function.1
(loop for n in *cl-macro-symbols*
unless (macro-function n)
collect n)
nil)
(deftest macro-function.2
(loop for n in *cl-macro-symbols*
unless (macro-function n nil)
collect n)
nil)
(deftest macro-function.3
(loop for n in *cl-macro-symbols*
unless (eval `(macrolet ((%m (s &environment env)
(list 'quote
(macro-function s env))))
(%m ,n)))
collect n)
nil)
(deftest macro-function.4
(macro-function (gensym))
nil)
(deftest macro-function.5
(remove-if-not #'macro-function *cl-function-symbols*)
nil)
(deftest macro-function.6
(remove-if-not #'macro-function *cl-accessor-symbols*)
nil)
(deftest macro-function.7
(let ((fn
(macrolet ((%m () 16))
(macrolet ((%n (&environment env)
(list 'quote (macro-function '%m env))))
(%n)))))
(values
(notnot (functionp fn))
(funcall fn '(%m) nil)))
t 16)
(deftest macro-function.8
(let ((sym (gensym)))
(setf (macro-function sym) (macro-function 'pop))
(eval `(let ((x '(a b c)))
(values
(,sym x)
x))))
a (b c))
(deftest macro-function.9
(let ((sym (gensym)))
(setf (macro-function sym nil) (macro-function 'pop))
(eval `(let ((x '(a b c)))
(values
(,sym x)
x))))
a (b c))
(deftest macro-function.10
(let ((sym (gensym)))
(eval `(defun ,sym (x) :bad))
(setf (macro-function sym) (macro-function 'pop))
(eval `(let ((x '(a b c)))
(values
(,sym x)
x))))
a (b c))
(deftest macro-function.11
(let ((fn
(flet ((%m () 16))
(macrolet ((%n (&environment env)
(list 'quote (macro-function '%m env))))
(%n)))))
fn)
nil)
;;; Error tests
(deftest macro-function.error.1
(signals-error (macro-function) program-error)
t)
(deftest macro-function.error.2
(signals-error (macro-function 'pop nil nil) program-error)
t)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment