comparison tests/automated/lisp-tests.el @ 5553:62edcc6a11ec

Add an assertion about argument order to #'apply-partially compiler macro lisp/ChangeLog addition: 2011-08-24 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (apply-partially): Add an assertion to this compiler macro, requiring that the order of the placeholders corresponding to the arguments in the constants vector of the constructed compiled function be the same as the order of the arguments to #'apply-partially. tests/ChangeLog addition: 2011-08-24 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Add a test of apply partially that depends on the relative order of its arguments.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 24 Aug 2011 11:06:41 +0100
parents b908c7265a2b
children 58b38d5b32d0
comparison
equal deleted inserted replaced
5550:b908c7265a2b 5553:62edcc6a11ec
2927 (test-symbol-macrolet)))) 2927 (test-symbol-macrolet))))
2928 2928
2929 ;; Basic tests of #'apply-partially. 2929 ;; Basic tests of #'apply-partially.
2930 (let* ((four 4) 2930 (let* ((four 4)
2931 (times-four (apply-partially '* four)) 2931 (times-four (apply-partially '* four))
2932 (plus-twelve (apply-partially '+ 6 (* 3 2)))) 2932 (plus-twelve (apply-partially '+ 6 (* 3 2)))
2933 (construct-list (apply-partially 'list (incf four) (incf four)
2934 (incf four))))
2933 (Assert (eql (funcall times-four 6) 24)) 2935 (Assert (eql (funcall times-four 6) 24))
2934 (Assert (eql (funcall times-four 4 4) 64)) 2936 (Assert (eql (funcall times-four 4 4) 64))
2935 (Assert (eql (funcall plus-twelve (funcall times-four 4) 4 4) 36)) 2937 (Assert (eql (funcall plus-twelve (funcall times-four 4) 4 4) 36))
2936 (Check-Error wrong-number-of-arguments (apply-partially))) 2938 (Check-Error wrong-number-of-arguments (apply-partially))
2939 (Assert (equal (funcall construct-list) '(5 6 7))))
2937 2940
2938 ;;; end of lisp-tests.el 2941 ;;; end of lisp-tests.el