Mercurial > hg > xemacs-beta
comparison tests/automated/lisp-tests.el @ 5299:28651c24b3f8
Error in #'list-length if LIST is dotted; check for this error with #'mapcar
src/ChangeLog addition:
2010-11-06 Aidan Kehoe <kehoea@parhasard.net>
* fns.c (Flist_length): Error if LIST is dotted in this function;
document this behaviour.
tests/ChangeLog addition:
2010-11-06 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el (malformed-list): Check that #'mapcar,
#'map and #'list-length throw this error when appropriate.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 06 Nov 2010 14:51:13 +0000 |
parents | 2474dce7304e |
children | 9f738305f80f |
comparison
equal
deleted
inserted
replaced
5298:99006e0b3a84 | 5299:28651c24b3f8 |
---|---|
1037 (Assert (eql | 1037 (Assert (eql |
1038 (length (multiple-value-list | 1038 (length (multiple-value-list |
1039 (car (mapcar #'(lambda (argument) (floor argument)) (list pi e))))) | 1039 (car (mapcar #'(lambda (argument) (floor argument)) (list pi e))))) |
1040 1) | 1040 1) |
1041 "checking multiple values are correctly discarded in mapcar") | 1041 "checking multiple values are correctly discarded in mapcar") |
1042 | |
1043 (let ((malformed-list '(1 2 3 4 hi there . tail))) | |
1044 (Check-Error malformed-list (mapcar #'identity malformed-list)) | |
1045 (Check-Error malformed-list (map nil #'eq [1 2 3 4] | |
1046 malformed-list)) | |
1047 (Check-Error malformed-list (list-length malformed-list))) | |
1042 | 1048 |
1043 ;;----------------------------------------------------- | 1049 ;;----------------------------------------------------- |
1044 ;; Test vector functions | 1050 ;; Test vector functions |
1045 ;;----------------------------------------------------- | 1051 ;;----------------------------------------------------- |
1046 (Assert (equal [1 2 3] [1 2 3])) | 1052 (Assert (equal [1 2 3] [1 2 3])) |