Commit 900e9e05 authored by pfdietz's avatar pfdietz

Added macro env tests for function starting with 'b'.

parent 764366ea
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((0 0)(0 1)))
(deftest bit-and.20
(macrolet ((%m (z) z)) (bit-and (expand-in-current-env (%m #*0011)) #*0101))
#*0001)
(deftest bit-and.21
(macrolet ((%m (z) z)) (bit-and #*1010 (expand-in-current-env (%m #*1100))))
#*1000)
(deftest bit-and.22
(macrolet ((%m (z) z)) (bit-and #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*00100010)
(deftest bit-and.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((0 0)(1 0)))
(deftest bit-andc1.20
(macrolet ((%m (z) z)) (bit-andc1 (expand-in-current-env (%m #*0011)) #*0101))
#*0100)
(deftest bit-andc1.21
(macrolet ((%m (z) z)) (bit-andc1 #*1010 (expand-in-current-env (%m #*1100))))
#*0100)
(deftest bit-andc1.22
(macrolet ((%m (z) z)) (bit-andc1 #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*01001000)
(deftest bit-andc1.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((0 1)(0 0)))
(deftest bit-andc2.20
(macrolet ((%m (z) z)) (bit-andc2 (expand-in-current-env (%m #*0011)) #*0101))
#*0010)
(deftest bit-andc2.21
(macrolet ((%m (z) z)) (bit-andc2 #*1010 (expand-in-current-env (%m #*1100))))
#*0010)
(deftest bit-andc2.22
(macrolet ((%m (z) z)) (bit-andc2 #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*10000001)
(deftest bit-andc2.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -221,6 +221,19 @@
#2a((0 0)(1 1))
#2a((1 0)(0 1)))
(deftest bit-eqv.20
(macrolet ((%m (z) z)) (bit-eqv (expand-in-current-env (%m #*0011)) #*0101))
#*1001)
(deftest bit-eqv.21
(macrolet ((%m (z) z)) (bit-eqv #*1010 (expand-in-current-env (%m #*1100))))
#*1001)
(deftest bit-eqv.22
(macrolet ((%m (z) z)) (bit-eqv #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*00110110)
(deftest bit-eqv.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((0 1)(1 1)))
(deftest bit-ior.20
(macrolet ((%m (z) z)) (bit-ior (expand-in-current-env (%m #*0011)) #*0101))
#*0111)
(deftest bit-ior.21
(macrolet ((%m (z) z)) (bit-ior #*1010 (expand-in-current-env (%m #*1100))))
#*1110)
(deftest bit-ior.22
(macrolet ((%m (z) z)) (bit-ior #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*11101011)
(deftest bit-ior.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((1 1)(1 0)))
(deftest bit-nand.20
(macrolet ((%m (z) z)) (bit-nand (expand-in-current-env (%m #*0011)) #*0101))
#*1110)
(deftest bit-nand.21
(macrolet ((%m (z) z)) (bit-nand #*1010 (expand-in-current-env (%m #*1100))))
#*0111)
(deftest bit-nand.22
(macrolet ((%m (z) z)) (bit-nand #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*11011101)
(deftest bit-nand.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((1 0)(0 0)))
(deftest bit-nor.20
(macrolet ((%m (z) z)) (bit-nor (expand-in-current-env (%m #*0011)) #*0101))
#*1000)
(deftest bit-nor.21
(macrolet ((%m (z) z)) (bit-nor #*1010 (expand-in-current-env (%m #*1100))))
#*0001)
(deftest bit-nor.22
(macrolet ((%m (z) z)) (bit-nor #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*00010100)
(deftest bit-nor.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -119,6 +119,22 @@
#2a((0 1)(1 0))
#2a((1 0)(0 1)))
;;; Macro env tests
(deftest bit-not.16
(macrolet
((%m (z) z))
(bit-not (expand-in-current-env (%m #*10010011))))
#*01101100)
(deftest bit-not.17
(macrolet
((%m (z) z))
(bit-not #*1101011010 (expand-in-current-env (%m nil))))
#*0010100101)
;;;
(deftest bit-not.order.1
(let ((a (copy-seq #*001101))
(i 0) x)
......
......@@ -220,6 +220,20 @@
#2a((0 0)(1 1))
#2a((1 0)(1 1)))
(deftest bit-orc1.20
(macrolet ((%m (z) z)) (bit-orc1 (expand-in-current-env (%m #*0011)) #*0101))
#*1101)
(deftest bit-orc1.21
(macrolet ((%m (z) z)) (bit-orc1 #*1010 (expand-in-current-env (%m #*1100))))
#*1101)
(deftest bit-orc1.22
(macrolet ((%m (z) z)) (bit-orc1 #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*01111110)
(deftest bit-orc1.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((1 1)(0 1)))
(deftest bit-orc2.20
(macrolet ((%m (z) z)) (bit-orc2 (expand-in-current-env (%m #*0011)) #*0101))
#*1011)
(deftest bit-orc2.21
(macrolet ((%m (z) z)) (bit-orc2 #*1010 (expand-in-current-env (%m #*1100))))
#*1011)
(deftest bit-orc2.22
(macrolet ((%m (z) z)) (bit-orc2 #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*10110111)
(deftest bit-orc2.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -50,6 +50,13 @@
(check-type-predicate #'bit-vector-p 'bit-vector)
nil)
(deftest bit-vector-p.13
(macrolet
((%m (z) z))
(values (notnot (bit-vector-p (expand-in-current-env (%m #*110101))))
(bit-vector-p (expand-in-current-env (%m nil)))))
t nil)
(deftest bit-vector-p.order.1
(let ((i 0) x)
(values
......
......@@ -220,6 +220,19 @@
#2a((0 0)(1 1))
#2a((0 1)(1 0)))
(deftest bit-xor.20
(macrolet ((%m (z) z)) (bit-xor (expand-in-current-env (%m #*0011)) #*0101))
#*0110)
(deftest bit-xor.21
(macrolet ((%m (z) z)) (bit-xor #*1010 (expand-in-current-env (%m #*1100))))
#*0110)
(deftest bit-xor.22
(macrolet ((%m (z) z)) (bit-xor #*10100011 #*01101010
(expand-in-current-env (%m nil))))
#*11001001)
(deftest bit-xor.order.1
(let* ((s1 (make-array 1 :initial-element 0 :element-type 'bit))
(s2 (make-array 1 :initial-element 0 :element-type 'bit))
......
......@@ -114,6 +114,15 @@
collect (list n x y result1 result2)))
nil)
(deftest boole.4
(macrolet ((%m (z) z))
(values (boole (expand-in-current-env (%m boole-and)) #b11001100 #b01011010)
(boole boole-and (expand-in-current-env (%m #b11001100)) #b01011010)
(boole boole-and #b11001100 (expand-in-current-env (%m #b01011010)))))
#b01001000
#b01001000
#b01001000)
;;; Order of evaluation
(deftest boole.order.1
(let ((i 0) a b c)
......
......@@ -54,6 +54,10 @@
collect x)
nil)
(deftest boundp.6
(macrolet ((%m (z) z)) (boundp (expand-in-current-env (%m '#:foo))))
nil)
(deftest boundp.order.1
(let ((i 0) x)
(values
......
......@@ -59,6 +59,13 @@
(butlast '(a b c d e) (1- most-positive-fixnum))
nil)
(deftest butlast.9
(macrolet ((%m (z) z))
(values (butlast (expand-in-current-env (%m (list 'a 'b 'c))))
(butlast (list 'a 'b 'c 'd 'e) (expand-in-current-env (%m 2)))))
(a b)
(a b c))
(deftest butlast.order.1
(let ((i 0) x y)
(values
......
......@@ -35,6 +35,28 @@
(eql j (byte-position bspec))))))
t)
(deftest byte.4
(macrolet
((%m (z) z))
(let ((b (byte (expand-in-current-env (%m 2)) 5)))
(values (byte-size b) (byte-position b))))
2 5)
(deftest byte.5
(macrolet
((%m (z) z))
(let ((b (byte 31 (expand-in-current-env (%m 7)))))
(values (byte-size b) (byte-position b))))
31 7)
(deftest byte-size.1
(macrolet ((%m (z) z)) (byte-size (expand-in-current-env (%m (byte 3 7)))))
3)
(deftest byte-position.1
(macrolet ((%m (z) z)) (byte-position (expand-in-current-env (%m (byte 3 7)))))
7)
(deftest byte-position.error.1
(signals-error (byte-position) program-error)
t)
......
......@@ -487,6 +487,10 @@
(char-type-error-check #'both-case-p)
t)
(deftest both-case-p.4
(notnot (macrolet ((%m (z) z)) (both-case-p (expand-in-current-env (%m #\a)))))
t)
(deftest both-case-p.order.1
(let ((i 0))
(values
......
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