Commit cd1aca75 authored by pfdietz's avatar pfdietz

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
;;; 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 "gclload2.lsp")
(in-package :cl-test)
......
......@@ -9,6 +9,7 @@
(let ((x (make-sequence 'list 4)))
(and (eql (length x) 4)
(listp x)
#+:ansi-tests-strict-initial-element
(loop for e in x always (eql (car x) e))
t))
t)
......@@ -21,6 +22,7 @@
(let ((x (make-sequence 'cons 4)))
(and (eql (length x) 4)
(listp x)
#+:ansi-tests-strict-initial-element
(loop for e in x always (eql (car x) e))
t))
t)
......@@ -36,6 +38,7 @@
(deftest make-sequence.6
(let ((s (make-sequence 'string 10)))
(and (eql (length s) 10)
#+:ansi-tests-strict-initial-element
(loop for e across s always (eql e (aref s 0)))
t))
t)
......@@ -44,9 +47,11 @@
(make-sequence 'simple-string 10 :initial-element #\a)
"aaaaaaaaaa")
(deftest make-sequence.8
(let ((s (make-sequence 'simple-string 10)))
(and (eql (length s) 10)
#+:ansi-tests-strict-initial-element
(loop for e across s always (eql e (aref s 0)))
t))
t)
......@@ -58,6 +63,7 @@
(deftest make-sequence.10
(let ((x (make-sequence 'vector 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......@@ -73,6 +79,7 @@
(deftest make-sequence.12
(let ((x (make-sequence 'simple-vector 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......@@ -88,6 +95,7 @@
(deftest make-sequence.14
(let ((x (make-sequence '(vector *) 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......@@ -103,6 +111,7 @@
(deftest make-sequence.16
(let ((x (make-sequence '(simple-vector *) 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......@@ -118,6 +127,7 @@
(deftest make-sequence.18
(let ((x (make-sequence '(string *) 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......@@ -133,6 +143,7 @@
(deftest make-sequence.20
(let ((x (make-sequence '(simple-string *) 10)))
(and (eql (length x) 10)
#+:ansi-tests-strict-initial-element
(loop for e across x always (eql e (aref x 0)))
t))
t)
......
......@@ -8,7 +8,8 @@
(deftest make-string.1
(let ((s (make-string 10)))
(and (stringp s)
;; (string-all-the-same s)
#+:ansi-tests-strict-initial-element
(string-all-the-same s)
(eqlt (length s) 10)
))
t)
......@@ -52,7 +53,8 @@
(let ((s (make-string 10 :element-type 'character)))
(and (stringp s)
(eqlt (length s) 10)
#| (string-all-the-same s) |#
#+:ansi-tests-strict-initial-element
(string-all-the-same s)
))
t)
......@@ -60,7 +62,8 @@
(let ((s (make-string 10 :element-type 'standard-char)))
(and (stringp s)
(eqlt (length s) 10)
#| (string-all-the-same s) |#
#+:ansi-tests-strict-initial-element
(string-all-the-same s)
))
t)
......@@ -68,7 +71,8 @@
(let ((s (make-string 10 :element-type 'base-char)))
(and (stringp s)
(eqlt (length s) 10)
#| (string-all-the-same s) |#
#+:ansi-tests-strict-initial-element
(string-all-the-same s)
))
t)
......
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