Commit 61747b81 authored by pfdietz's avatar pfdietz

More tests on displaced vectors, strings on POSITION-IF, POSITION-IF-NOT

parent 9186e87c
......@@ -217,6 +217,14 @@
(position-if-not #'symbolp a :from-end t)))
nil 0 nil 4)
(deftest position-if-not-vector.14
(let* ((v1 #(x x x a b 1 d a b 2 d y y y y y))
(v2 (make-array '(8) :displaced-to v1
:displaced-index-offset 3)))
(values (position-if-not #'symbolp v2)
(position-if-not #'symbolp v2 :from-end t)))
2 6)
;;; Bit vector tests
(deftest position-if-not-bit-vector.1
......@@ -444,6 +452,20 @@
(position-if-not (complement #'digit-char-p) a :from-end t))))
nil 0 nil 4)
(deftest position-if-not-string.14
(do-special-strings
(s "12345a6 78b90" nil)
(let ((pos (position-if-not (complement #'alpha-char-p) s)))
(assert (eql pos 5) () "First alpha char in ~A is at position ~A" s pos)))
nil)
(deftest position-if-not-string.15
(do-special-strings
(s "12345a6 78b90" nil)
(let ((pos (position-if-not (complement #'alpha-char-p) s :from-end t)))
(assert (eql pos 11) () "Last alpha char in ~A is at position ~A" s pos)))
nil)
(deftest position-if-not.order.1
(let ((i 0) a b c d e f)
(values
......
......@@ -213,7 +213,15 @@
(flet ((%f (x) (eql x 1)))
(values (position-if #'%f a)
(position-if #'%f a :from-end t))))
0 2)
0 2)
(deftest position-if-vector.14
(let* ((v1 #(x x x a b 1 d a b 2 d y y y y y))
(v2 (make-array '(8) :displaced-to v1
:displaced-index-offset 3)))
(values (position-if #'integerp v2)
(position-if #'integerp v2 :from-end t)))
2 6)
;;; Bit vector tests
......@@ -441,6 +449,21 @@
(position-if #'%g a :from-end 'foo))))
nil nil 0 4)
(deftest position-if-string.14
(do-special-strings
(s "12345a6 78b90" nil)
(let ((pos (position-if #'alpha-char-p s)))
(assert (eql pos 5) () "First alpha char in ~A is at position ~A" s pos)))
nil)
(deftest position-if-string.15
(do-special-strings
(s "12345a6 78b90" nil)
(let ((pos (position-if #'alpha-char-p s :from-end t)))
(assert (eql pos 11) () "Last alpha char in ~A is at position ~A" s pos)))
nil)
(deftest position-if.order.1
(let ((i 0) a b c d e f)
(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