Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ansi-test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Karsten Poeck
ansi-test
Commits
b100a650
Commit
b100a650
authored
Sep 30, 2003
by
pfdietz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start of hash table tests.
parent
2d1f46f3
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
39 deletions
+143
-39
ansi-tests/gclload2.lsp
ansi-tests/gclload2.lsp
+1
-4
ansi-tests/hash-table-p.lsp
ansi-tests/hash-table-p.lsp
+43
-0
ansi-tests/hash-table.lsp
ansi-tests/hash-table.lsp
+0
-30
ansi-tests/load-hash-tables.lsp
ansi-tests/load-hash-tables.lsp
+3
-0
ansi-tests/make-hash-table.lsp
ansi-tests/make-hash-table.lsp
+96
-5
No files found.
ansi-tests/gclload2.lsp
View file @
b100a650
...
...
@@ -25,10 +25,7 @@
(load "load-arrays.lsp")
;;; Tests of hash tables
(load "hash-table.lsp")
(load "make-hash-table.lsp")
; More to come
(load "load-hash-tables.lsp")
;;; Tests of packages
...
...
ansi-tests/hash-table-p.lsp
0 → 100644
View file @
b100a650
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Tue Sep 16 21:58:37 2003
;;;; Contains: Tests for HASH-TABLE-P
(in-package :cl-test)
(deftest hash-table-p.1
(loop for e in '(nil t 1 10.0 (a b c) #(a b c) #*1011
#0aNIL #2a((a b)(c d)) #p"foo"
"bar" #\a 3/5 #c(1.0 2.0))
when (hash-table-p e)
collect e)
nil)
(deftest hash-table-p.2
(loop for e in *universe*
for p = (typep e 'hash-table)
for q = (hash-table-p e)
always (if p q (not q)))
t)
(deftest hash-table-p.3
(let ((i 0))
(values (hash-table-p (incf i)) i))
nil 1)
(deftest hash-table-p.4
(hash-table-p t)
nil)
(deftest hash-table-p.5
(notnot-mv (hash-table-p (make-hash-table)))
t)
(deftest hash-table-p.error.1
(classify-error (hash-table-p))
program-error)
(deftest hash-table-p.error.2
(classify-error (let ((h (make-hash-table))) (hash-table-p h nil)))
program-error)
ansi-tests/hash-table.lsp
View file @
b100a650
...
...
@@ -34,36 +34,6 @@
(notnot-mv (typep (make-hash-table) (find-class 'hash-table)))
t)
;;;
(deftest hash-table-p.1
(loop for e in '(nil t 1 10.0 (a b c) #(a b c) #*1011
#0aNIL #2a((a b)(c d)) #p"foo"
"bar" #\a 3/5 #c(1.0 2.0))
when (hash-table-p e)
collect e)
nil)
(deftest hash-table-p.2
(loop for e in *universe*
for p = (typep e 'hash-table)
for q = (hash-table-p e)
always (if p q (not q)))
t)
(deftest hash-table-p.3
(let ((i 0))
(values (hash-table-p (incf i)) i))
nil 1)
(deftest hash-table-p.error.1
(classify-error (hash-table-p))
program-error)
(deftest hash-table-p.error.2
(classify-error (let ((h (make-hash-table))) (hash-table-p h nil)))
program-error)
...
...
ansi-tests/load-hash-tables.lsp
0 → 100644
View file @
b100a650
(load "hash-table.lsp")
(load "make-hash-table.lsp")
(load "hash-table-p.lsp")
\ No newline at end of file
ansi-tests/make-hash-table.lsp
View file @
b100a650
...
...
@@ -4,13 +4,104 @@
;;;; Contains: Tests for MAKE-HASH-TABLE
(in-package :cl-test)
#|
(deftest make-hash-table.1
(let ((ht (make-hash-table)))
(values
(check-values (typep ht 'hash-table))
(notnot (check-values (hash-table-p ht)))
(check-values (hash-table-count ht))
|#
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.2
(let ((ht (make-hash-table :size 0)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.3
(let ((ht (make-hash-table :size 100)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.4
(let ((ht (make-hash-table :test #'eq)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.5
(let ((ht (make-hash-table :test 'eq)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.6
(let ((ht (make-hash-table :test #'eql)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.7
(let ((ht (make-hash-table :test 'eql)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.8
(let ((ht (make-hash-table :test #'equal)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.9
(let ((ht (make-hash-table :test 'equal)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.10
(let ((ht (make-hash-table :test #'equalp)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
(deftest make-hash-table.11
(let ((ht (make-hash-table :test 'equalp)))
(values
(notnot (typep ht 'hash-table))
(notnot (hash-table-p ht))
(hash-table-count ht)))
t t 0)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment