source: trunk/source/tests/ansi-tests/eql.lsp @ 8991

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

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

File size: 1.4 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Oct 17 19:36:33 2002
4;;;; Contains: Tests of EQL
5
6(in-package :cl-test)
7
8;;; EQLT is defined in ansi-aux.lsp
9;;; It calls EQL, returning NIL when the result is false and T when it
10;;; is true.
11
12(deftest eql.1
13  (check-predicate #'(lambda (x) (eql x x)))
14  nil)
15
16(deftest eql.2
17  (eqlt 2 (1+ 1))
18  t)
19
20(deftest eql.3
21  (let ((x "abc"))
22    (eql x (copy-seq x)))
23  nil)
24
25(deftest eql.4
26  (eqlt #\a #\a)
27  t)
28
29(deftest eql.5
30  (eqlt 12345678901234567890 12345678901234567890)
31  t)
32
33(deftest eql.7
34  (eql 12.0 12)
35  nil)
36
37(deftest eql.8
38  (eqlt #c(1 -2) #c(1 -2))
39  t)
40
41(deftest eql.9
42  (let ((x "abc") (y "abc"))
43    (if (eq x y) (eqlt x y) (not (eql x y))))
44  t)
45
46(deftest eql.10
47  (eql (list 'a) (list 'b))
48  nil)
49
50(deftest eql.11
51  (eqlt #c(1 -2) (- #c(-1 2)))
52  t)
53
54(deftest eql.order.1
55  (let ((i 0) x y)
56    (values
57     (eql (setf x (incf i)) (setf y (incf i)))
58     i x y))
59  nil 2 1 2)
60
61;;; Error tests for EQL
62
63(deftest eql.error.1
64  (signals-error (eql) program-error)
65  t)
66
67(deftest eql.error.2
68  (signals-error (eql nil) program-error)
69  t)
70
71(deftest eql.error.3
72  (signals-error (eql nil nil nil) program-error)
73  t)
74
75;;; Error tests for EQ
76
77(deftest eq.error.1
78  (signals-error (eq) program-error)
79  t)
80
81(deftest eq.error.2
82  (signals-error (eq nil) program-error)
83  t)
84
85(deftest eq.error.3
86  (signals-error (eq nil nil nil) program-error)
87  t)
Note: See TracBrowser for help on using the repository browser.