Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ansi-test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michał Herda
ansi-test
Commits
f15b5f19
Commit
f15b5f19
authored
22 years ago
by
pfdietz
Browse files
Options
Downloads
Patches
Plain Diff
Added tests for EQL. Also, added T-versions of EQL, EQUAL, EQUALP.
parent
5d7f0d72
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansi-tests/ansi-aux.lsp
+21
-7
21 additions, 7 deletions
ansi-tests/ansi-aux.lsp
ansi-tests/eql.lsp
+54
-0
54 additions, 0 deletions
ansi-tests/eql.lsp
ansi-tests/gclload2.lsp
+1
-0
1 addition, 0 deletions
ansi-tests/gclload2.lsp
with
76 additions
and
7 deletions
ansi-tests/ansi-aux.lsp
+
21
−
7
View file @
f15b5f19
...
...
@@ -9,19 +9,33 @@
(declaim (optimize (safety 3)))
(defun eqt (x y)
"
Function l
ike EQ, but guaranteed to return T for true."
"
L
ike EQ, but guaranteed to return T for true."
(if (eq x y) t nil))
(defun eqlt (x y)
"Like EQL, but guaranteed to return T for true."
(if (eql x y) t nil))
(defun equalt (x y)
"Like EQUAL, but guaranteed to return T for true."
(if (equal x y) t nil))
(defun equalpt (x y)
"Like EQUALP, but guaranteed to return T for true."
(if (equalp x y) t nil))
(defun =t (x &rest args)
"Like =, but guaranteed to return T for true."
(if (apply #'= x args) t nil))
(defun notnot (x) (not (not x)))
(defun make-int-list (n)
(loop for i from 0
to (1-
n
)
collect i))
(loop for i from 0
below
n collect i))
(defun make-int-array (n &optional (fn #'make-array))
(let ((a (funcall fn n)))
(loop
for i from 0 to (1- n) do
(setf (aref a i) i))
(loop for i from 0 below n do (setf (aref a i) i))
a))
(defun equal-array (a1 a2)
...
...
@@ -33,12 +47,12 @@
(if (= (array-rank a1) 1)
(let ((as (first ad)))
(loop
for i from 0
to (1-
as
)
for i from 0
below
as
always (equal (aref a1 i) (aref a2 i))))
(let ((as (array-total-size a1)))
(and (= as (array-total-size a2))
(loop
for i from 0
to (1-
as
)
for i from 0
below
as
always (equal (row-major-aref a1 i)
(row-major-aref a2 i))))))))))
...
...
This diff is collapsed.
Click to expand it.
ansi-tests/eql.lsp
0 → 100644
+
54
−
0
View file @
f15b5f19
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Thu Oct 17 19:36:33 2002
;;;; Contains: Tests of EQL
(in-package :cl-test)
;;; EQLT is defined in ansi-aux.lsp
;;; It calls EQL, returning NIL when the result is false and T when it
;;; is true.
(deftest eql.1
(loop for x in *universe* always (eql x x))
t)
(deftest eql.2
(eqlt 2 (1+ 1))
t)
(deftest eql.3
(let ((x "abc"))
(eql x (copy-seq x)))
nil)
(deftest eql.4
(eqlt #\a #\a)
t)
(deftest eql.5
(eqlt 12345678901234567890 12345678901234567890)
t)
(deftest eql.7
(eql 12.0 12)
nil)
(deftest eql.8
(eqlt #c(1 -2) #c(1 -2))
t)
(deftest eql.9
(let ((x "abc") (y "abc"))
(if (eq x y) (eqlt x y) (not (eql x y))))
t)
(deftest eql.10
(eql (list 'a) (list 'b))
nil)
(deftest eql.11
(eqlt #c(1 -2) (- #c(-1 2)))
t)
;;; There are many other uses of EQL in other files.
This diff is collapsed.
Click to expand it.
ansi-tests/gclload2.lsp
+
1
−
0
View file @
f15b5f19
...
...
@@ -19,6 +19,7 @@
(load "defparameter.lsp")
(load "defvar.lsp")
(load "destructuring-bind.lsp")
(load "eql.lsp")
(load "fboundp.lsp")
(load "flet.lsp")
(load "fmakunbound.lsp")
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment