source: trunk/source/tests/ansi-tests/simple-string-p.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.7 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Aug 29 17:31:24 2004
4;;;; Contains: Tests of SIMPLE-STRING-P
5
6(in-package :cl-test)
7
8(deftest simple-string-p.1
9  (check-type-predicate #'simple-string-p 'simple-string)
10  nil)
11
12(deftest simple-string-p.2
13  (notnot-mv (simple-string-p "ancd"))
14  t)
15
16(deftest simple-string-p.3
17  (simple-string-p 0)
18  nil)
19
20;;; (deftest simple-string-p.4
21;;;  (simple-string-p (make-array 4 :element-type 'character
22;;;                            :initial-contents '(#\a #\a #\a #\b)
23;;;                            :fill-pointer t))
24;;;  nil)
25
26(deftest simple-string-p.5
27  (notnot-mv
28   (simple-string-p (make-array
29                     4 :element-type 'base-char
30                     :initial-contents '(#\a #\a #\a #\b))))
31  t)
32
33(deftest simple-string-p.6
34  (notnot-mv
35   (simple-string-p (make-array
36                     4 :element-type 'standard-char
37                     :initial-contents '(#\a #\a #\a #\b))))
38  t)
39
40;;; (deftest simple-string-p.7
41;;;  (let* ((s (make-array 10 :element-type 'character
42;;;                     :initial-element #\a))
43;;;      (s2 (make-array 4 :element-type 'character
44;;;                      :displaced-to s
45;;;                      :displaced-index-offset 2)))
46;;;    (simple-string-p s2))
47;;;  nil)
48
49(deftest simple-string-p.8
50  :notes (:nil-vectors-are-strings)
51  (notnot-mv (simple-string-p (make-array '(0) :element-type nil)))
52  t)
53
54(deftest simple-string-p.9
55  :notes (:nil-vectors-are-strings)
56  (notnot-mv (simple-string-p (make-array '(37) :element-type nil)))
57  t)
58
59(deftest simple-string-p.10
60  (let ((i 0))
61    (values
62     (notnot (simple-string-p (progn (incf i) "")))
63     i))
64  t 1)
65
66;;; Error tests
67
68(deftest simple-string-p.error.1
69  (signals-error (simple-string-p) program-error)
70  t)
71
72(deftest simple-string-p.error.2
73  (signals-error (simple-string-p "" nil) program-error)
74  t)
Note: See TracBrowser for help on using the repository browser.