Mercurial > hg > xemacs-beta
comparison tests/automated/lisp-tests.el @ 5700:37479d841681
Fix subsetp based on patch by Benson and Steven Mitchell.
Add appropriate short-circuits for null set arguments.
Add tests (mostly from Steven Mitchell) to test suite.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Mon, 24 Dec 2012 14:12:51 +0900 |
parents | 289cf21be887 |
children | 3192994c49ca |
comparison
equal
deleted
inserted
replaced
5699:a95c89dc9695 | 5700:37479d841681 |
---|---|
2433 (Assert (eq | 2433 (Assert (eq |
2434 (gethash (* 2 most-positive-fixnum) hashing) | 2434 (gethash (* 2 most-positive-fixnum) hashing) |
2435 (gethash hashed-bignum hashing)) | 2435 (gethash hashed-bignum hashing)) |
2436 "checking hashing works correctly with #'eql tests and bignums")))) | 2436 "checking hashing works correctly with #'eql tests and bignums")))) |
2437 | 2437 |
2438 ;; #'subsetp tests. | |
2439 ;; Return non-nil if every element of LIST1 also appears in LIST2. | |
2440 ;; A couple of non-nondegenerate false cases. | |
2441 (Assert (not (subsetp (list ?a ?b) (list ?c ?d)))) | |
2442 (Assert (not (subsetp (list ?a ?b) (list ?b ?c ?d)))) | |
2443 ;; Next five thanks to Steven and Benson Mitchell on XEmacs Beta | |
2444 ;; <50D16FF7.4090708@bnin.net>. | |
2445 ;; Two non-degenerate true cases. | |
2446 (Assert (subsetp (list ?a) (list ?a ?b ?c ?d))) | |
2447 (Assert (subsetp (list ?a ?b) (list ?a ?b ?c ?d))) | |
2448 ;; The three degenerate cases involving nil. | |
2449 (Assert (not (subsetp (list ?a) nil))) | |
2450 (Assert (subsetp nil (list ?a ?b ?c ?d))) | |
2451 (Assert (subsetp nil nil)) | |
2452 ;; #### We should also test the keywords. | |
2453 ;; #### We should also test the error conditions. | |
2454 | |
2438 ;; | 2455 ;; |
2439 (when (decode-char 'ucs #x0192) | 2456 (when (decode-char 'ucs #x0192) |
2440 (Check-Error | 2457 (Check-Error |
2441 invalid-state | 2458 invalid-state |
2442 (let ((str "aaaaaaaaaaaaa") | 2459 (let ((str "aaaaaaaaaaaaa") |