From 0f788f8e3270d4d9d450b692c42743c86073211c Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Mon, 23 Jan 2006 14:34:12 +0000 Subject: [PATCH] More macro env tests --- ansi-tests/assoc-if-not.lsp | 2 +- ansi-tests/assoc-if.lsp | 19 +++++++++++++++++++ ansi-tests/atan.lsp | 4 ++++ ansi-tests/atanh.lsp | 3 +++ ansi-tests/atom.lsp | 10 ++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ansi-tests/assoc-if-not.lsp b/ansi-tests/assoc-if-not.lsp index cb7e1699..192354e1 100644 --- a/ansi-tests/assoc-if-not.lsp +++ b/ansi-tests/assoc-if-not.lsp @@ -119,7 +119,7 @@ (assoc-if-not #'evenp alist :key (expand-in-current-env (%m '1+))) ))) (4 . c) - (4 . c)) + (4 . c)) ;;; Error tests diff --git a/ansi-tests/assoc-if.lsp b/ansi-tests/assoc-if.lsp index 249336e2..0e00f639 100644 --- a/ansi-tests/assoc-if.lsp +++ b/ansi-tests/assoc-if.lsp @@ -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 diff --git a/ansi-tests/atan.lsp b/ansi-tests/atan.lsp index 54c77b0a..50b55b1c 100644 --- a/ansi-tests/atan.lsp +++ b/ansi-tests/atan.lsp @@ -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 diff --git a/ansi-tests/atanh.lsp b/ansi-tests/atanh.lsp index 1d4adffe..94e883a3 100644 --- a/ansi-tests/atanh.lsp +++ b/ansi-tests/atanh.lsp @@ -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 diff --git a/ansi-tests/atom.lsp b/ansi-tests/atom.lsp index b9905c6b..2cc53b19 100644 --- a/ansi-tests/atom.lsp +++ b/ansi-tests/atom.lsp @@ -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)) -- GitLab