Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Gary Palter
ansi-test
Commits
ce9d2a25
Commit
ce9d2a25
authored
Jan 17, 2003
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more keyword argument handling tests.
parent
1a87ed65
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1095 additions
and
44 deletions
+1095
-44
ansi-tests/cons-test-02.lsp
ansi-tests/cons-test-02.lsp
+214
-16
ansi-tests/cons-test-03.lsp
ansi-tests/cons-test-03.lsp
+14
-2
ansi-tests/cons-test-04.lsp
ansi-tests/cons-test-04.lsp
+14
-2
ansi-tests/cons-test-13.lsp
ansi-tests/cons-test-13.lsp
+20
-2
ansi-tests/cons-test-14.lsp
ansi-tests/cons-test-14.lsp
+41
-6
ansi-tests/cons-test-16.lsp
ansi-tests/cons-test-16.lsp
+67
-9
ansi-tests/count-if-not.lsp
ansi-tests/count-if-not.lsp
+1
-1
ansi-tests/count-if.lsp
ansi-tests/count-if.lsp
+5
-2
ansi-tests/count.lsp
ansi-tests/count.lsp
+2
-2
ansi-tests/make-sequence.lsp
ansi-tests/make-sequence.lsp
+27
-0
ansi-tests/make-string.lsp
ansi-tests/make-string.lsp
+35
-1
ansi-tests/mismatch.lsp
ansi-tests/mismatch.lsp
+34
-0
ansi-tests/nsubstitute-if-not.lsp
ansi-tests/nsubstitute-if-not.lsp
+42
-0
ansi-tests/nsubstitute-if.lsp
ansi-tests/nsubstitute-if.lsp
+38
-0
ansi-tests/nsubstitute.lsp
ansi-tests/nsubstitute.lsp
+39
-0
ansi-tests/position-if-not.lsp
ansi-tests/position-if-not.lsp
+42
-0
ansi-tests/position-if.lsp
ansi-tests/position-if.lsp
+43
-1
ansi-tests/position.lsp
ansi-tests/position.lsp
+41
-0
ansi-tests/reduce.lsp
ansi-tests/reduce.lsp
+40
-0
ansi-tests/remove-duplicates.lsp
ansi-tests/remove-duplicates.lsp
+83
-0
ansi-tests/remove.lsp
ansi-tests/remove.lsp
+63
-0
ansi-tests/replace.lsp
ansi-tests/replace.lsp
+35
-0
ansi-tests/search-list.lsp
ansi-tests/search-list.lsp
+38
-0
ansi-tests/substitute-if-not.lsp
ansi-tests/substitute-if-not.lsp
+41
-0
ansi-tests/substitute-if.lsp
ansi-tests/substitute-if.lsp
+38
-0
ansi-tests/substitute.lsp
ansi-tests/substitute.lsp
+38
-0
No files found.
ansi-tests/cons-test-02.lsp
View file @
ce9d2a25
...
...
@@ -95,10 +95,34 @@
:key nil)
(2 2 b b))
(deftest sublis-9
(sublis nil 'a :bad-keyword t :allow-other-keys t)
;;; Keyword tests
(deftest sublis.allow-other-keys.1
(sublis nil 'a :bad t :allow-other-keys t)
a)
(deftest sublis.allow-other-keys.2
(sublis nil 'a :allow-other-keys t :bad t)
a)
(deftest sublis.allow-other-keys.3
(sublis nil 'a :allow-other-keys t)
a)
(deftest sublis.allow-other-keys.4
(sublis nil 'a :allow-other-keys nil)
a)
(deftest sublis.allow-other-keys.5
(sublis nil 'a :allow-other-keys t :allow-other-keys t :bad t)
a)
(deftest sublis.keywords.6
(sublis '((1 . a)) (list 0 1 2) :key #'(lambda (x) (if (numberp x) (1+ x) x))
:key #'identity)
(a 1 2))
;; Argument error cases
(deftest sublis.error.1
...
...
@@ -181,6 +205,34 @@
:key nil)
(2 2 b b))
;;; Keyword tests
(deftest nsublis.allow-other-keys.1
(nsublis nil 'a :bad t :allow-other-keys t)
a)
(deftest nsublis.allow-other-keys.2
(nsublis nil 'a :allow-other-keys t :bad t)
a)
(deftest nsublis.allow-other-keys.3
(nsublis nil 'a :allow-other-keys t)
a)
(deftest nsublis.allow-other-keys.4
(nsublis nil 'a :allow-other-keys nil)
a)
(deftest nsublis.allow-other-keys.5
(nsublis nil 'a :allow-other-keys t :allow-other-keys t :bad t)
a)
(deftest nsublis.keywords.6
(nsublis '((1 . a)) (list 0 1 2)
:key #'(lambda (x) (if (numberp x) (1+ x) x))
:key #'identity)
(a 1 2))
;; Argument error cases
(deftest nsublis.error.1
...
...
@@ -262,9 +314,35 @@
:key nil)
(a a c d a a))
(deftest subst-10
(subst 'a 'b nil :bad t :allow-other-keys t)
nil)
;;; Keyword tests for subst
(deftest subst.allow-other-keys.1
(subst 'a 'b (list 'a 'b 'c) :bad t :allow-other-keys t)
(a a c))
(deftest subst.allow-other-keys.2
(subst 'a 'b (list 'a 'b 'c) :allow-other-keys t)
(a a c))
(deftest subst.allow-other-keys.3
(subst 'a 'b (list 'a 'b 'c) :allow-other-keys nil)
(a a c))
(deftest subst.allow-other-keys.4
(subst 'a 'b (list 'a 'b 'c) :allow-other-keys t :bad t)
(a a c))
(deftest subst.allow-other-keys.5
(subst 'a 'b (list 'a 'b 'c) :allow-other-keys t :allow-other-keys nil
:bad t)
(a a c))
(deftest subst.keywords.6
(subst 'a 'b (list 'a 'b 'c) :test #'eq :test (complement #'eq))
(a a c))
;;; Tests for subst-if, subst-if-not
(deftest subst-if-1
(check-subst-if 'a #'consp '((100 1) (2 3) (4 3 2 1) (a b c)))
...
...
@@ -332,20 +410,63 @@
:key nil)
((a) (a) (c) (d)))
(deftest subst-if-7
(subst-if 'a #'null nil :bad t :allow-other-keys t)
a)
(deftest subst-if-not-5
(check-subst-if-not 'a #'(lambda (x) (not (eql x 'b)))
'((a) (b) (c) (d))
:key nil)
((a) (a) (c) (d)))
(deftest subst-if-not-7
(subst-if 'a #'identity nil :bad t :allow-other-keys t)
nil)
;;; Keyword tests for subst-if
(deftest subst-if.allow-other-keys.1
(subst-if 'a #'null nil :bad t :allow-other-keys t)
a)
(deftest subst-if.allow-other-keys.2
(subst-if 'a #'null nil :allow-other-keys t)
a)
(deftest subst-if.allow-other-keys.3
(subst-if 'a #'null nil :allow-other-keys nil)
a)
(deftest subst-if.allow-other-keys.4
(subst-if 'a #'null nil :allow-other-keys t :bad t)
a)
(deftest subst-if.allow-other-keys.5
(subst-if 'a #'null nil :allow-other-keys t :allow-other-keys nil :bad t)
a)
(deftest subst-if.keywords.6
(subst-if 'a #'null nil :key nil :key (constantly 'b))
a)
;;; Keywords tests for subst-if-not
(deftest subst-if-not.allow-other-keys.1
(subst-if-not 'a #'identity nil :bad t :allow-other-keys t)
a)
(deftest subst-if-not.allow-other-keys.2
(subst-if-not 'a #'identity nil :allow-other-keys t)
a)
(deftest subst-if-not.allow-other-keys.3
(subst-if-not 'a #'identity nil :allow-other-keys nil)
a)
(deftest subst-if-not.allow-other-keys.4
(subst-if-not 'a #'identity nil :allow-other-keys t :bad t)
a)
(deftest subst-if-not.allow-other-keys.5
(subst-if-not 'a #'identity nil :allow-other-keys t :allow-other-keys nil :bad t)
a)
(deftest subst-if-not.keywords.6
(subst-if-not 'a #'identity nil :key nil :key (constantly 'b))
a)
(defvar *nsubst-tree-1* '(10 (30 20 10) (20 10) (10 20 30 40)))
...
...
@@ -404,9 +525,34 @@
:key nil)
(a a c d a a))
(deftest nsubst-10
(nsubst 'a 'b nil :bad t :allow-other-keys t)
nil)
;;; Keyword tests for nsubst
(deftest nsubst.allow-other-keys.1
(nsubst 'a 'b (list 'a 'b 'c) :bad t :allow-other-keys t)
(a a c))
(deftest nsubst.allow-other-keys.2
(nsubst 'a 'b (list 'a 'b 'c) :allow-other-keys t)
(a a c))
(deftest nsubst.allow-other-keys.3
(nsubst 'a 'b (list 'a 'b 'c) :allow-other-keys nil)
(a a c))
(deftest nsubst.allow-other-keys.4
(nsubst 'a 'b (list 'a 'b 'c) :allow-other-keys t :bad t)
(a a c))
(deftest nsubst.allow-other-keys.5
(nsubst 'a 'b (list 'a 'b 'c) :allow-other-keys t :allow-other-keys nil
:bad t)
(a a c))
(deftest nsubst.keywords.6
(nsubst 'a 'b (list 'a 'b 'c) :test #'eq :test (complement #'eq))
(a a c))
;;; Tests for nsubst-if, nsubst-if-not
(deftest nsubst-if-1
(check-nsubst-if 'a #'consp '((100 1) (2 3) (4 3 2 1) (a b c)))
...
...
@@ -488,6 +634,58 @@
(nsubst-if-not 'a #'null nil :bad t :allow-other-keys t)
nil)
;;; Keyword tests for nsubst-if
(deftest nsubst-if.allow-other-keys.1
(nsubst-if 'a #'null nil :bad t :allow-other-keys t)
a)
(deftest nsubst-if.allow-other-keys.2
(nsubst-if 'a #'null nil :allow-other-keys t)
a)
(deftest nsubst-if.allow-other-keys.3
(nsubst-if 'a #'null nil :allow-other-keys nil)
a)
(deftest nsubst-if.allow-other-keys.4
(nsubst-if 'a #'null nil :allow-other-keys t :bad t)
a)
(deftest nsubst-if.allow-other-keys.5
(nsubst-if 'a #'null nil :allow-other-keys t :allow-other-keys nil :bad t)
a)
(deftest nsubst-if.keywords.6
(nsubst-if 'a #'null nil :key nil :key (constantly 'b))
a)
;;; Keywords tests for nsubst-if-not
(deftest nsubst-if-not.allow-other-keys.1
(nsubst-if-not 'a #'identity nil :bad t :allow-other-keys t)
a)
(deftest nsubst-if-not.allow-other-keys.2
(nsubst-if-not 'a #'identity nil :allow-other-keys t)
a)
(deftest nsubst-if-not.allow-other-keys.3
(nsubst-if-not 'a #'identity nil :allow-other-keys nil)
a)
(deftest nsubst-if-not.allow-other-keys.4
(nsubst-if-not 'a #'identity nil :allow-other-keys t :bad t)
a)
(deftest nsubst-if-not.allow-other-keys.5
(nsubst-if-not 'a #'identity nil :allow-other-keys t :allow-other-keys nil :bad t)
a)
(deftest nsubst-if-not.keywords.6
(nsubst-if-not 'a #'identity nil :key nil :key (constantly 'b))
a)
;;; Error cases
;;; subst
...
...
ansi-tests/cons-test-03.lsp
View file @
ce9d2a25
...
...
@@ -189,14 +189,26 @@
(make-list 6 :initial-element 'a)
(a a a a a a))
(deftest make-list
-other-keyword
s.1
(deftest make-list
.allow-other-key
s.1
(make-list 5 :allow-other-keys t :foo 'a)
(nil nil nil nil nil))
(deftest make-list
-other-keyword
s.2
(deftest make-list
.allow-other-key
s.2
(make-list 5 :bar nil :allow-other-keys t)
(nil nil nil nil nil))
(deftest make-list.allow-other-keys.3
(make-list 5 :allow-other-keys nil)
(nil nil nil nil nil))
(deftest make-list.allow-other-keys.4
(make-list 5 :allow-other-keys t :allow-other-keys nil 'bad t)
(nil nil nil nil nil))
(deftest make-list.allow-other-keys.5
(make-list 5 :allow-other-keys t)
(nil nil nil nil nil))
(deftest make-list-repeated-keyword
(make-list 5 :initial-element 'a :initial-element 'b)
(a a a a a))
...
...
ansi-tests/cons-test-04.lsp
View file @
ce9d2a25
...
...
@@ -258,14 +258,26 @@
:test-not (complement #'equal) :key nil)
(aaa "AAA" "aaa" #\a))
(deftest adjoin
-other-keys-
1
(deftest adjoin
.allow-other-keys.
1
(adjoin 'a '(b c) :bad t :allow-other-keys t)
(a b c))
(deftest adjoin
-other-keys-
2
(deftest adjoin
.allow-other-keys.
2
(adjoin 'a '(b c) :allow-other-keys t :foo t)
(a b c))
(deftest adjoin.allow-other-keys.3
(adjoin 'a '(b c) :allow-other-keys t)
(a b c))
(deftest adjoin.allow-other-keys.4
(adjoin 'a '(b c) :allow-other-keys nil)
(a b c))
(deftest adjoin.allow-other-keys.5
(adjoin 'a '(b c) :allow-other-keys t :allow-other-keys nil 'bad t)
(a b c))
(deftest adjoin-repeat-key
(adjoin 'a '(b c) :test #'eq :test (complement #'eq))
(a b c))
...
...
ansi-tests/cons-test-13.lsp
View file @
ce9d2a25
...
...
@@ -143,11 +143,29 @@
(member 'z '(a b c d) :key nil)
nil)
(deftest member-20
;;; Keyword tests
(deftest member.allow-other-keys.1
(member 'b '(a b c) :bad t :allow-other-keys t)
(b c))
(deftest member-21
(deftest member.allow-other-keys.2
(member 'b '(a b c) :allow-other-keys t :bad t)
(b c))
(deftest member.allow-other-keys.3
(member 'b '(a b c) :allow-other-keys t)
(b c))
(deftest member.allow-other-keys.4
(member 'b '(a b c) :allow-other-keys nil)
(b c))
(deftest member.allow-other-keys.5
(member 'b '(a b c) :allow-other-keys 17 :allow-other-keys nil '#:x t)
(b c))
(deftest member.keywords.6
(member 'b '(a b c) :test #'eq :test (complement #'eq))
(b c))
...
...
ansi-tests/cons-test-14.lsp
View file @
ce9d2a25
...
...
@@ -43,18 +43,37 @@
(member-if #'identity '(1 2 3 4 5) :key #'evenp)
(2 3 4 5))
(deftest member-if-6
;;; Keyword tests
(deftest member-if.keywords.1
(member-if #'identity '(1 2 3 4 5) :key #'evenp :key #'oddp)
(2 3 4 5))
(deftest member-if
-7
(deftest member-if
.allow-other-keys.2
(member-if #'identity '(nil 2 3 4 5) :allow-other-keys t :bad t)
(2 3 4 5))
(deftest member-if
-8
(deftest member-if
.allow-other-keys.3
(member-if #'identity '(nil 2 3 4 5) :bad t :allow-other-keys t)
(2 3 4 5))
(deftest member-if.allow-other-keys.4
(member-if #'identity '(nil 2 3 4 5) :allow-other-keys t)
(2 3 4 5))
(deftest member-if.allow-other-keys.5
(member-if #'identity '(nil 2 3 4 5) :allow-other-keys nil)
(2 3 4 5))
(deftest member-if.allow-other-keys.5
(member-if #'identity '(nil 2 3 4 5) :allow-other-keys t
:allow-other-keys nil)
(2 3 4 5))
(deftest member-if.allow-other-keys.6
(member-if #'identity '(nil 2 3 4 5) :allow-other-keys t
:allow-other-keys nil :key #'identity :key #'null)
(2 3 4 5))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; member-if-not
...
...
@@ -92,18 +111,34 @@
(member-if-not #'not '(1 2 3 4 5) :key #'evenp)
(2 3 4 5))
(deftest member-if-not-6
;;; Keyword tests
(deftest member-if-not.keywords.1
(member-if-not #'not '(1 2 3 4 5) :key #'evenp :key #'oddp)
(2 3 4 5))
(deftest member-if-not
-7
(deftest member-if-not
.allow-other-keys.2
(member-if-not #'not '(nil 2 3 4 5) :allow-other-keys t :bad t)
(2 3 4 5))
(deftest member-if-not
-8
(deftest member-if-not
.allow-other-keys.3
(member-if-not #'not '(nil 2 3 4 5) :bad t :allow-other-keys t)
(2 3 4 5))
(deftest member-if-not.allow-other-keys.4
(member-if-not #'not '(nil 2 3 4 5) :allow-other-keys t)
(2 3 4 5))
(deftest member-if-not.allow-other-keys.5
(member-if-not #'not '(nil 2 3 4 5) :allow-other-keys nil)
(2 3 4 5))
(deftest member-if-not.allow-other-keys.6
(member-if-not #'not '(nil 2 3 4 5) :allow-other-keys t
:allow-other-keys nil :key #'identity :key #'null)
(2 3 4 5))
;;; Error cases
(deftest member-if.error.1
...
...
ansi-tests/cons-test-16.lsp
View file @
ce9d2a25
...
...
@@ -194,19 +194,38 @@
(eqt x y))))
(A . 3))
(deftest assoc-26
;;; Keyword tests
(deftest assoc.allow-other-keys.1
(assoc 'b '((a . 1) (b . 2) (c . 3)) :bad t :allow-other-keys t)
(b . 2))
(deftest assoc
-27
(deftest assoc
.allow-other-keys.2
(assoc 'b '((a . 1) (b . 2) (c . 3)) :allow-other-keys t :also-bad t)
(b . 2))
(deftest assoc
-28
(deftest assoc
.allow-other-keys.3
(assoc 'b '((a . 1) (b . 2) (c . 3)) :allow-other-keys t :also-bad t
:test-not #'eql)
(a . 1))
(deftest assoc.allow-other-keys.4
(assoc 'b '((a . 1) (b . 2) (c . 3)) :allow-other-keys t)
(b . 2))
(deftest assoc.allow-other-keys.5
(assoc 'b '((a . 1) (b . 2) (c . 3)) :allow-other-keys nil)
(b . 2))
(deftest assoc.keywords.6
(assoc 'b '((a . 1) (b . 2) (c . 3)) :key #'identity :key #'null)
(b . 2))
(deftest assoc.keywords.7
(assoc 'b '((a . 1) (b . 2) (c . 3)) :key nil :key #'null)
(b . 2))
(deftest assoc.error.1
(classify-error (assoc))
program-error)
...
...
@@ -268,20 +287,38 @@
(assoc-if #'null '((a . b) nil (c . d) (nil . e) (f . g)))
(nil . e))
(deftest assoc-if-5
;;; Keyword tests
(deftest assoc-if.allow-other-keys.1
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :bad t :allow-other-keys t)
(nil . 2))
(deftest assoc-if
-6
(deftest assoc-if
.allow-other-keys.2
(assoc-if #'null '((a . 1) (nil . 2) (c . 3))
:allow-other-keys t :also-bad t)
(nil . 2))
(deftest assoc-if
-7
(deftest assoc-if
.allow-other-keys.3
(assoc-if #'null '((a . 1) (nil . 2) (c . 3))
:allow-other-keys t :also-bad t :key #'not)
(a . 1))
(deftest assoc-if.allow-other-keys.4
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :allow-other-keys t)
(nil . 2))
(deftest assoc-if.allow-other-keys.5
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :allow-other-keys nil)
(nil . 2))
(deftest assoc-if.keywords.6
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :key #'identity :key #'null)
(nil . 2))
(deftest assoc-if.keywords.7
(assoc-if #'null '((a . 1) (nil . 2) (c . 3)) :key nil :key #'null)
(nil . 2))
;;; Error cases
(deftest assoc-if.error.1
...
...
@@ -345,21 +382,42 @@
(assoc-if-not #'identity '((a . b) nil (c . d) (nil . e) (f . g)))
(nil . e))
(deftest assoc-if-not-5
;;; Keyword tests
(deftest assoc-if-not.allow-other-keys.1
(assoc-if-not #'identity
'((a . 1) (nil . 2) (c . 3)) :bad t :allow-other-keys t)
(nil . 2))
(deftest assoc-if-not
-6
(deftest assoc-if-not
.allow-other-keys.2
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3))
:allow-other-keys t :also-bad t)
(nil . 2))
(deftest assoc-if-not
-7
(deftest assoc-if-not
.allow-other-keys.3
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3))
:allow-other-keys t :also-bad t :key #'not)
(a . 1))
(deftest assoc-if-not.allow-other-keys.4
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3)) :allow-other-keys t)
(nil . 2))
(deftest assoc-if-not.allow-other-keys.5
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3)) :allow-other-keys nil)
(nil . 2))
(deftest assoc-if-not.keywords.6
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3))
:key #'identity :key #'null)
(nil . 2))
(deftest assoc-if-not.keywords.7
(assoc-if-not #'identity '((a . 1) (nil . 2) (c . 3)) :key nil :key #'null)
(nil . 2))
;;; Error tests
(deftest assoc-if-not.error.1
(classify-error (assoc-if-not))
program-error)
...
...
ansi-tests/count-if-not.lsp
View file @
ce9d2a25
...
...
@@ -418,7 +418,7 @@
(count-if-not #'%onep a :from-end t)))))
2 3 2 3)
;;;
Allow-other-keys
tests
;;;
Keyword
tests
(deftest count-if-not.keywords.1
(count-if-not #'oddp '(1 2 3 4 5) :bad t :allow-other-keys t)
...
...
ansi-tests/count-if.lsp
View file @
ce9d2a25
...
...
@@ -417,7 +417,7 @@
(count-if #'digit-char-p s :start 1 :end 2)))
3 3 2 2 1)
;;;
Allow-other-keys
tests
;;;
Keyword
tests
(deftest count-if.allow-other-keys.1
(count-if #'evenp '(1 2 3 4 5) :bad t :allow-other-keys t)
...
...
@@ -435,10 +435,13 @@
:bad t)
2)
(deftest count-if.
allow-other-key
s.4
(deftest count-if.
keyword
s.4
(count-if #'evenp '(1 2 3 4 5) :key #'identity :key #'1+)
2)
(deftest count-if.allow-other-keys.5
(count-if #'evenp '(1 2 3 4 5) :allow-other-keys nil)
2)
;;; Error tests
...
...
ansi-tests/count.lsp
View file @
ce9d2a25
...
...
@@ -486,7 +486,7 @@
:start 2 :end 5)
3)
;;;
Allow-other-keys
tests
;;;
Keyword
tests
(deftest count.allow-other-keys.1
(count 'a '(b a d a c) :bad t :allow-other-keys t)
...
...
@@ -504,7 +504,7 @@
:bad t)
2)
(deftest count.
allow-other-key
s.4
(deftest count.
keyword
s.4
(count 2 '(1 2 3 2 5) :key #'identity :key #'1+)
2)
...
...
ansi-tests/make-sequence.lsp
View file @
ce9d2a25
...
...
@@ -165,6 +165,33 @@
(equalp (make-sequence 'string 5) (make-string 5))
t)
;;; Keyword tests
(deftest make-sequence.allow-other-keys.1
(make-sequence 'list 5 :allow-other-keys t :initial-element 'a :bad t)
(a a a a a))
(deftest make-sequence.allow-other-keys.2
(make-sequence 'list 5 :initial-element 'a :bad t :allow-other-keys t)
(a a a a a))
(deftest make-sequence.allow-other-keys.3
(make-sequence 'list 5 :initial-element 'a :allow-other-keys t)
(a a a a a))
(deftest make-sequence.allow-other-keys.4
(make-sequence 'list 5 :initial-element 'a :allow-other-keys nil)
(a a a a a))
(deftest make-sequence.allow-other-keys.5
(make-sequence 'list 5 :initial-element 'a :allow-other-keys t
:allow-other-keys nil :bad t)
(a a a a a))
(deftest make-sequence.keywords.6
(make-sequence 'list 5 :initial-element 'a :initial-element 'b)
(a a a a a))
;;; Tests for errors
(deftest make-sequence.error.1
...
...
ansi-tests/make-string.lsp
View file @
ce9d2a25
...
...
@@ -72,7 +72,41 @@
))
t)
;;; Error cases
;;; Keyword tests
;
(deftest make-string.allow-other-keys.1
(make-string 5 :allow-other-keys t :initial-element #\a)
"aaaaa")
(deftest make-string.allow-other-keys.2
(make-string 5 :initial-element #\a :allow-other-keys t)
"aaaaa")
(deftest make-string.allow-other-keys.3
(make-string 5 :initial-element #\a :allow-other-keys t
:bad t)
"aaaaa")
(deftest make-string.allow-other-keys.4
(make-string 5 :bad t :allow-other-keys t :allow-other-keys nil
:initial-element #\a)
"aaaaa")
(deftest make-string.allow-other-keys.5
(make-string 5 :allow-other-keys t :bad t :allow-other-keys nil
:initial-element #\a)
"aaaaa")
(deftest make-string.allow-other-keys.6
(make-string 5 :allow-other-keys t :allow-other-keys nil :bad nil
:initial-element #\a)
"aaaaa")
(deftest make-string.keywords.7
(make-string 5 :initial-element #\a :initial-element #\b)
"aaaaa")
;; Error cases
(deftest make-string.error.1
(classify-error (make-string))
...
...
ansi-tests/mismatch.lsp
View file @
ce9d2a25
...
...
@@ -597,6 +597,40 @@
(mismatch m a :from-end t)))
(4 4 5 nil nil 6 5 6))
;;; Keyword tests
(deftest mismatch.allow-other-keys.1
(mismatch "1234" "1244" :allow-other-keys t :bad t)
2)
(deftest mismatch.allow-other-keys.2
(mismatch "1234" "1244" :bad t :allow-other-keys t)
2)
(deftest mismatch.allow-other-keys.3
(mismatch "1234" "1244" :bad t :allow-other-keys t :allow-other-keys nil)
2)
(deftest mismatch.allow-other-keys.4
(mismatch "1234" "1244" :allow-other-keys t :bad t
:allow-other-keys nil)
2)
(deftest mismatch.allow-other-keys.5
(mismatch "1234" "1244" :allow-other-keys t
:allow-other-keys nil
:bad t)
2)
(deftest mismatch.keywords.6
(mismatch "1234" "1244" :test #'equal :test (complement #'equal))
2)
(deftest mismatch.allow-other-keys.7
(mismatch "1234" "1244" :bad t :allow-other-keys t
:test (complement #'equal))
0)
;;; Error cases
(deftest mismatch.error.1
...
...
ansi-tests/nsubstitute-if-not.lsp
View file @
ce9d2a25
...
...
@@ -633,6 +633,48 @@
result)
#*01111)
;;; Keyword tests
(deftest nsubstitute-if-not.allow-other-keys.1
(nsubstitute-if-not 'a #'zerop (list 1 2 0 3 1 0 3)
:allow-other-keys t :bad t)
(a a 0 a a 0 a))
(deftest nsubstitute-if-not.allow-other-keys.2
(nsubstitute-if-not 'a #'zerop (list 1 2 0 3 1 0 3)
:bad t :allow-other-keys t)
(a a 0 a a 0 a))
(deftest nsubstitute-if-not.allow-other-keys.3
(nsubstitute-if-not 'a #'zerop (list 1 2 0 3 1 0 3) :allow-other-keys t
:allow-other-keys nil :bad t)
(a a 0 a a 0 a))
(deftest nsubstitute-if-not.allow-other-keys.4
(nsubstitute-if-not 'a #'zerop (list 1 2 0 3 1 0 3) :bad t
:allow-other-keys t :allow-other-keys nil)
(a a 0 a a 0 a))
(deftest nsubstitute-if-not.allow-other-keys.5
(nsubstitute-if-not 'a #'zerop (list 1 2 0 3 1 0