Skip to content
Snippets Groups Projects
Commit 0f788f8e authored by pfdietz's avatar pfdietz
Browse files

More macro env tests

parent 900e9e05
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,7 @@
(assoc-if-not #'evenp alist :key (expand-in-current-env (%m '1+)))
)))
(4 . c)
(4 . c))
(4 . c))
;;; Error tests
......
......@@ -99,6 +99,25 @@
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :key nil :key #'null)
(nil . 2))
;;; Macro env tests
(deftest assoc-if.env.1
(macrolet
((%m (z) z))
(let ((alist '((1 . a) (3 . b) (6 . c) (8 . d) (-1 . e))))
(values
(assoc-if (expand-in-current-env (%m 'evenp)) alist)
(assoc-if (expand-in-current-env (%m #'evenp)) alist)
(assoc-if #'evenp (expand-in-current-env (%m alist)))
(assoc-if 'oddp alist (expand-in-current-env (%m :key)) '1+)
(assoc-if 'oddp alist :key (expand-in-current-env (%m #'1+)))
)))
(6 . c)
(6 . c)
(6 . c)
(6 . c)
(6 . c))
;;; Error cases
(deftest assoc-if.error.1
......
......@@ -119,6 +119,10 @@
collect (approx= (atan (coerce -1 type)) (coerce (/ pi -4) type)))
(t t t t))
(deftest atan.14
(macrolet ((%m (z) z)) (atan (expand-in-current-env (%m 0.0))))
0.0)
;;; FIXME
;;; More accuracy tests here
......
......@@ -93,6 +93,9 @@
collect (list x1 rlist)))
nil)
(deftest atanh.8
(macrolet ((%m (z) z)) (atanh (expand-in-current-env (%m 0.0))))
0.0)
;;; FIXME
......
......@@ -7,6 +7,16 @@
; (compile-and-load "cons-aux.lsp")
(deftest atom.1
(loop for x in *universe*
unless (if (atom x) (not (consp x)) (consp x))
collect x)
nil)
(deftest atom.2
(macrolet ((%m (z) z)) (atom (expand-in-current-env (%m 0))))
t)
(deftest atom.order.1
(let ((i 0))
(values (atom (progn (incf i) '(a b))) i))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment