comparison tests/automated/lisp-tests.el @ 5445:6506fcb40fcf

Merged with trunk.
author Mats Lidell <matsl@xemacs.org>
date Fri, 31 Dec 2010 00:27:29 +0100
parents 8d29f1c4bb98 f87bb35a6b94
children 89331fa1c819
comparison
equal deleted inserted replaced
5444:388762703a21 5445:6506fcb40fcf
2545 (Check-Error wrong-type-argument 2545 (Check-Error wrong-type-argument
2546 (fill [1 2 3 4 5] 1 :start (float most-positive-fixnum))) 2546 (fill [1 2 3 4 5] 1 :start (float most-positive-fixnum)))
2547 (Check-Error wrong-type-argument 2547 (Check-Error wrong-type-argument
2548 (fill "1 2 3 4 5" ?1 :start (float most-positive-fixnum))) 2548 (fill "1 2 3 4 5" ?1 :start (float most-positive-fixnum)))
2549 (Check-Error wrong-type-argument 2549 (Check-Error wrong-type-argument
2550 (fill #*10101010 1 :start (float most-positive-fixnum)) 2550 (fill #*10101010 1 :start (float most-positive-fixnum)))
2551 (Check-Error wrong-type-argument 2551 (Check-Error wrong-type-argument
2552 (fill '(1 2 3 4 5) 1 :end (float most-positive-fixnum))) 2552 (fill '(1 2 3 4 5) 1 :end (float most-positive-fixnum)))
2553 (Check-Error wrong-type-argument 2553 (Check-Error wrong-type-argument
2554 (fill [1 2 3 4 5] 1 :end (float most-positive-fixnum))) 2554 (fill [1 2 3 4 5] 1 :end (float most-positive-fixnum)))
2555 (Check-Error wrong-type-argument 2555 (Check-Error wrong-type-argument
2665 :end1 (1+ most-positive-fixnum))) 2665 :end1 (1+ most-positive-fixnum)))
2666 (Check-Error args-out-of-range 2666 (Check-Error args-out-of-range
2667 (replace '(1 2 3 4 5) [5 4 3 2 1] 2667 (replace '(1 2 3 4 5) [5 4 3 2 1]
2668 :end2 (1+ most-positive-fixnum)))) 2668 :end2 (1+ most-positive-fixnum))))
2669 2669
2670 (symbol-macrolet
2671 ((list-length 2048) (vector-length 512) (string-length (* 8192 2)))
2672 (let ((list
2673 ;; CIRCULAR_LIST_SUSPICION_LENGTH is 1024, it's helpful if this list
2674 ;; is longer than that.
2675 (make-list list-length 'make-list))
2676 (vector (make-vector vector-length 'make-vector))
2677 (bit-vector (make-bit-vector vector-length 1))
2678 (string (make-string string-length
2679 (or (decode-char 'ucs #x20ac) ?\xFF)))
2680 (item 'cons))
2681 (dolist (function '(count position find delete* remove* reduce))
2682 (Check-Error args-out-of-range
2683 (funcall function item list
2684 :start (1+ list-length) :end (1+ list-length)))
2685 (Check-Error wrong-type-argument
2686 (funcall function item list
2687 :start -1 :end list-length))
2688 (Check-Error args-out-of-range
2689 (funcall function item list :end (* 2 list-length)))
2690 (Check-Error args-out-of-range
2691 (funcall function item vector
2692 :start (1+ vector-length) :end (1+ vector-length)))
2693 (Check-Error wrong-type-argument
2694 (funcall function item vector :start -1))
2695 (Check-Error args-out-of-range
2696 (funcall function item vector :end (* 2 vector-length)))
2697 (Check-Error args-out-of-range
2698 (funcall function item bit-vector
2699 :start (1+ vector-length) :end (1+ vector-length)))
2700 (Check-Error wrong-type-argument
2701 (funcall function item bit-vector :start -1))
2702 (Check-Error args-out-of-range
2703 (funcall function item bit-vector :end (* 2 vector-length)))
2704 (Check-Error args-out-of-range
2705 (funcall function item string
2706 :start (1+ string-length) :end (1+ string-length)))
2707 (Check-Error wrong-type-argument
2708 (funcall function item string :start -1))
2709 (Check-Error args-out-of-range
2710 (funcall function item string :end (* 2 string-length))))
2711 (dolist (function '(delete-duplicates remove-duplicates))
2712 (Check-Error args-out-of-range
2713 (funcall function (copy-sequence list)
2714 :start (1+ list-length) :end (1+ list-length)))
2715 (Check-Error wrong-type-argument
2716 (funcall function (copy-sequence list)
2717 :start -1 :end list-length))
2718 (Check-Error args-out-of-range
2719 (funcall function (copy-sequence list)
2720 :end (* 2 list-length)))
2721 (Check-Error args-out-of-range
2722 (funcall function (copy-sequence vector)
2723 :start (1+ vector-length) :end (1+ vector-length)))
2724 (Check-Error wrong-type-argument
2725 (funcall function (copy-sequence vector) :start -1))
2726 (Check-Error args-out-of-range
2727 (funcall function (copy-sequence vector)
2728 :end (* 2 vector-length)))
2729 (Check-Error args-out-of-range
2730 (funcall function (copy-sequence bit-vector)
2731 :start (1+ vector-length) :end (1+ vector-length)))
2732 (Check-Error wrong-type-argument
2733 (funcall function (copy-sequence bit-vector) :start -1))
2734 (Check-Error args-out-of-range
2735 (funcall function (copy-sequence bit-vector)
2736 :end (* 2 vector-length)))
2737 (Check-Error args-out-of-range
2738 (funcall function (copy-sequence string)
2739 :start (1+ string-length) :end (1+ string-length)))
2740 (Check-Error wrong-type-argument
2741 (funcall function (copy-sequence string) :start -1))
2742 (Check-Error args-out-of-range
2743 (funcall function (copy-sequence string)
2744 :end (* 2 string-length))))
2745 (dolist (function '(replace mismatch search))
2746 (Check-Error args-out-of-range
2747 (funcall function (copy-sequence list) (copy-sequence list)
2748 :start1 (1+ list-length) :end1 (1+ list-length)))
2749 (Check-Error wrong-type-argument
2750 (funcall function (copy-sequence list) (copy-sequence list)
2751 :start1 -1 :end1 list-length))
2752 (Check-Error args-out-of-range
2753 (funcall function (copy-sequence list) (copy-sequence list)
2754 :end1 (* 2 list-length)))
2755 (Check-Error args-out-of-range
2756 (funcall function (copy-sequence vector)
2757 (copy-sequence vector) :start1 (1+ vector-length)
2758 :end1 (1+ vector-length)))
2759 (Check-Error wrong-type-argument
2760 (funcall function (copy-sequence vector)
2761 (copy-sequence vector) :start1 -1))
2762 (Check-Error args-out-of-range
2763 (funcall function (copy-sequence vector)
2764 (copy-sequence vector)
2765 :end1 (* 2 vector-length)))
2766 (Check-Error args-out-of-range
2767 (funcall function (copy-sequence bit-vector)
2768 (copy-sequence bit-vector)
2769 :start1 (1+ vector-length)
2770 :end1 (1+ vector-length)))
2771 (Check-Error wrong-type-argument
2772 (funcall function (copy-sequence bit-vector)
2773 (copy-sequence bit-vector) :start1 -1))
2774 (Check-Error args-out-of-range
2775 (funcall function (copy-sequence bit-vector)
2776 (copy-sequence bit-vector)
2777 :end1 (* 2 vector-length)))
2778 (Check-Error args-out-of-range
2779 (funcall function (copy-sequence string)
2780 (copy-sequence string)
2781 :start1 (1+ string-length)
2782 :end1 (1+ string-length)))
2783 (Check-Error wrong-type-argument
2784 (funcall function (copy-sequence string)
2785 (copy-sequence string) :start1 -1))
2786 (Check-Error args-out-of-range
2787 (funcall function (copy-sequence string)
2788 (copy-sequence string)
2789 :end1 (* 2 string-length))))))
2790
2670 ;;; end of lisp-tests.el 2791 ;;; end of lisp-tests.el