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

Conditionalized parts of some MAKE-STRING and MAKE-SEQUENCE tests to control...

Conditionalized parts of some MAKE-STRING and MAKE-SEQUENCE tests to control whether we assume a missing :initial-element argument is assigned some single default value, or if those operations are free to leave the sequence/string filled with arbitrary legal garbage.
parent f73cf659
No related branches found
No related tags found
No related merge requests found
;;; Uncomment the next line to make MAKE-STRING and MAKE-SEQUENCE
;;; tests require that a missing :initial-element argument defaults
;;; to a single value, rather than leaving the string/sequence filled
;;; with arbitrary legal garbage.
;; (pushnew :ansi-tests-strict-initial-element *features*)
(load "gclload1.lsp") (load "gclload1.lsp")
(load "gclload2.lsp") (load "gclload2.lsp")
(in-package :cl-test) (in-package :cl-test)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
(let ((x (make-sequence 'list 4))) (let ((x (make-sequence 'list 4)))
(and (eql (length x) 4) (and (eql (length x) 4)
(listp x) (listp x)
#+:ansi-tests-strict-initial-element
(loop for e in x always (eql (car x) e)) (loop for e in x always (eql (car x) e))
t)) t))
t) t)
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
(let ((x (make-sequence 'cons 4))) (let ((x (make-sequence 'cons 4)))
(and (eql (length x) 4) (and (eql (length x) 4)
(listp x) (listp x)
#+:ansi-tests-strict-initial-element
(loop for e in x always (eql (car x) e)) (loop for e in x always (eql (car x) e))
t)) t))
t) t)
...@@ -36,6 +38,7 @@ ...@@ -36,6 +38,7 @@
(deftest make-sequence.6 (deftest make-sequence.6
(let ((s (make-sequence 'string 10))) (let ((s (make-sequence 'string 10)))
(and (eql (length s) 10) (and (eql (length s) 10)
#+:ansi-tests-strict-initial-element
(loop for e across s always (eql e (aref s 0))) (loop for e across s always (eql e (aref s 0)))
t)) t))
t) t)
...@@ -44,9 +47,11 @@ ...@@ -44,9 +47,11 @@
(make-sequence 'simple-string 10 :initial-element #\a) (make-sequence 'simple-string 10 :initial-element #\a)
"aaaaaaaaaa") "aaaaaaaaaa")
(deftest make-sequence.8 (deftest make-sequence.8
(let ((s (make-sequence 'simple-string 10))) (let ((s (make-sequence 'simple-string 10)))
(and (eql (length s) 10) (and (eql (length s) 10)
#+:ansi-tests-strict-initial-element
(loop for e across s always (eql e (aref s 0))) (loop for e across s always (eql e (aref s 0)))
t)) t))
t) t)
...@@ -58,6 +63,7 @@ ...@@ -58,6 +63,7 @@
(deftest make-sequence.10 (deftest make-sequence.10
(let ((x (make-sequence 'vector 10))) (let ((x (make-sequence 'vector 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
...@@ -73,6 +79,7 @@ ...@@ -73,6 +79,7 @@
(deftest make-sequence.12 (deftest make-sequence.12
(let ((x (make-sequence 'simple-vector 10))) (let ((x (make-sequence 'simple-vector 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
...@@ -88,6 +95,7 @@ ...@@ -88,6 +95,7 @@
(deftest make-sequence.14 (deftest make-sequence.14
(let ((x (make-sequence '(vector *) 10))) (let ((x (make-sequence '(vector *) 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
...@@ -103,6 +111,7 @@ ...@@ -103,6 +111,7 @@
(deftest make-sequence.16 (deftest make-sequence.16
(let ((x (make-sequence '(simple-vector *) 10))) (let ((x (make-sequence '(simple-vector *) 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
...@@ -118,6 +127,7 @@ ...@@ -118,6 +127,7 @@
(deftest make-sequence.18 (deftest make-sequence.18
(let ((x (make-sequence '(string *) 10))) (let ((x (make-sequence '(string *) 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
...@@ -133,6 +143,7 @@ ...@@ -133,6 +143,7 @@
(deftest make-sequence.20 (deftest make-sequence.20
(let ((x (make-sequence '(simple-string *) 10))) (let ((x (make-sequence '(simple-string *) 10)))
(and (eql (length x) 10) (and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0))) (loop for e across x always (eql e (aref x 0)))
t)) t))
t) t)
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
(deftest make-string.1 (deftest make-string.1
(let ((s (make-string 10))) (let ((s (make-string 10)))
(and (stringp s) (and (stringp s)
;; (string-all-the-same s) #+:ansi-tests-strict-initial-element
(string-all-the-same s)
(eqlt (length s) 10) (eqlt (length s) 10)
)) ))
t) t)
...@@ -52,7 +53,8 @@ ...@@ -52,7 +53,8 @@
(let ((s (make-string 10 :element-type 'character))) (let ((s (make-string 10 :element-type 'character)))
(and (stringp s) (and (stringp s)
(eqlt (length s) 10) (eqlt (length s) 10)
#| (string-all-the-same s) |# #+:ansi-tests-strict-initial-element
(string-all-the-same s)
)) ))
t) t)
...@@ -60,7 +62,8 @@ ...@@ -60,7 +62,8 @@
(let ((s (make-string 10 :element-type 'standard-char))) (let ((s (make-string 10 :element-type 'standard-char)))
(and (stringp s) (and (stringp s)
(eqlt (length s) 10) (eqlt (length s) 10)
#| (string-all-the-same s) |# #+:ansi-tests-strict-initial-element
(string-all-the-same s)
)) ))
t) t)
...@@ -68,7 +71,8 @@ ...@@ -68,7 +71,8 @@
(let ((s (make-string 10 :element-type 'base-char))) (let ((s (make-string 10 :element-type 'base-char)))
(and (stringp s) (and (stringp s)
(eqlt (length s) 10) (eqlt (length s) 10)
#| (string-all-the-same s) |# #+:ansi-tests-strict-initial-element
(string-all-the-same s)
)) ))
t) t)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment