Commit b10131e7 authored by pfdietz's avatar pfdietz
Browse files

Modifed define-modify-macro tests to ensure the modify macros are defined...

Modifed define-modify-macro tests to ensure the modify macros are defined before the subsequent forms are evaled.  The previous tests broke in systems that compiled everything before eval.
parent e59fbeb1
......@@ -6,61 +6,60 @@
(in-package :cl-test)
(deftest define-modify-macro.1
(let ((u '(p q r)) v)
(values
(define-modify-macro dmm1-appendf (&rest args)
append "Append lists onto a list")
(setq v u)
(dmm1-appendf u '(a b c d))
(dmm1-appendf u ())
(dmm1-appendf u '(e f g))
u
v))
(values
(eval '(define-modify-macro dmm1-appendf (&rest args)
append "Append lists onto a list"))
(eval
'(let ((u '(p q r)) v)
(list
(setq v u)
(dmm1-appendf u '(a b c d))
(dmm1-appendf u ())
(dmm1-appendf u '(e f g))
u
v))))
dmm1-appendf
(p q r)
(p q r a b c d)
(p q r a b c d)
(p q r a b c d e f g)
(p q r a b c d e f g)
(p q r))
((p q r)
(p q r a b c d)
(p q r a b c d)
(p q r a b c d e f g)
(p q r a b c d e f g)
(p q r)))
(deftest define-modify-macro.2
(let ((i 10))
(values
(define-modify-macro new-incf (&optional (delta 1)) +)
(new-incf i)
(new-incf i 100)
i))
(values
(eval '(define-modify-macro new-incf (&optional (delta 1)) +))
(eval
'(let ((i 10))
(list
(new-incf i)
(new-incf i 100)
i))))
new-incf
11
111
111)
(11 111 111))
(deftest define-modify-macro.3
(let ((a (vector 0 0 0 0 0))
(i 1))
(values
(define-modify-macro new-incf (&optional (delta 1)) +)
(new-incf (aref a (incf i)))
a
i))
new-incf
1
#(0 0 1 0 0)
2)
(values
(eval '(define-modify-macro new-incf1 (&optional (delta 1)) +))
(eval
'(let ((a (vector 0 0 0 0 0))
(i 1))
(list
(new-incf1 (aref a (incf i)))
a
i))))
new-incf1
(1 #(0 0 1 0 0) 2))
(deftest define-modify-macro.4
(let ((a (vector 0 0 0 0 0))
(i 1))
(values
(define-modify-macro new-incf (&optional (delta 1)) +)
(new-incf (aref a (incf i)) (incf i))
a
i))
new-incf
3
#(0 0 3 0 0)
3)
\ No newline at end of file
(values
(eval '(define-modify-macro new-incf2 (&optional (delta 1)) +))
(eval
'(let ((a (vector 0 0 0 0 0))
(i 1))
(list
(new-incf2 (aref a (incf i)) (incf i))
a
i))))
new-incf2
(3 #(0 0 3 0 0) 3))
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