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.0 KB

Line  

1  ;* Mode: Lisp * 

2  ;;;; Author: Paul Dietz 

3  ;;;; Created: Sat Apr 19 21:24:25 2003 

4  ;;;; Contains: Tests for CONS 

5  

6  (inpackage :cltest) 

7  

8  (compileandload "consaux.lsp") 

9  

10  ;;; Various easy tests of cons 

11  

12  (deftest consofsymbols 

13  (cons 'a 'b) 

14  (a . b)) 

15  

16  (deftest conswithnil 

17  (cons 'a nil) 

18  (a)) 

19  

20  ;;; successive calls to cons produces results that are equal, but not eq 

21  (deftest conseqequal 

22  (let ((x (cons 'a 'b)) 

23  (y (cons 'a 'b))) 

24  (and (not (eqt x y)) 

25  (equalt x y))) 

26  t) 

27  

28  ;;; list can be expressed as a bunch of conses (with nil) 

29  (deftest consequallist 

30  (equalt (cons 'a (cons 'b (cons 'c nil))) 

31  (list 'a 'b 'c)) 

32  t) 

33  

34  ;;; Order of evaluation of cons arguments 

35  (deftest cons.order.1 

36  (let ((i 0)) (values (cons (incf i) (incf i)) i)) 

37  (1 . 2) 2) 

38  

39  (deffoldtest cons.fold.1 (cons 'a 'b)) 

40  

41  ;;; Error tests 

42  

43  (deftest cons.error.1 

44  (signalserror (cons) programerror) 

45  t) 

46  

47  (deftest cons.error.2 

48  (signalserror (cons 'a) programerror) 

49  t) 

50  

51  (deftest cons.error.3 

52  (signalserror (cons 'a 'b 'c) programerror) 

53  t) 

Note: See
TracBrowser
for help on using the repository browser.