Mercurial > hg > xemacs-beta
comparison tests/automated/byte-compiler-tests.el @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 8626e4521993 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
20 ;; You should have received a copy of the GNU General Public License | 20 ;; You should have received a copy of the GNU General Public License |
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free | 21 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
23 ;; 02111-1307, USA. | 23 ;; 02111-1307, USA. |
24 | 24 |
25 ;;; Synched up with: not in FSF Emacs. | 25 ;;; Synched up with: Not in FSF. |
26 | 26 |
27 ;;; Commentary: | 27 ;;; Commentary: |
28 | 28 |
29 ;;; Test byte-compiler functionality | 29 ;;; Test byte-compiler functionality |
30 ;;; See test-harness.el | 30 ;;; See test-harness.el |
89 | 89 |
90 (Check-Error-Message | 90 (Check-Error-Message |
91 error "`let' bindings can have only one value-form" | 91 error "`let' bindings can have only one value-form" |
92 (eval '(let* ((x 1 2)) 3))) | 92 (eval '(let* ((x 1 2)) 3))) |
93 | 93 |
94 (defmacro before-and-after-compile-equal (&rest form) | |
95 `(Assert (equal (funcall (quote (lambda () ,@form))) | |
96 (funcall (byte-compile (quote (lambda () ,@form))))))) | |
97 | |
98 (defvar simplyamarker (point-min-marker)) | |
99 | |
100 ;; The byte optimizer must be careful with +/- with a single argument. | |
101 | |
102 (before-and-after-compile-equal (+)) | |
103 (before-and-after-compile-equal (+ 2 2)) | |
104 (before-and-after-compile-equal (+ 2 1)) | |
105 (before-and-after-compile-equal (+ 1 2)) | |
106 ;; (+ 1) is OK. but (+1) signals an error. | |
107 (before-and-after-compile-equal (+ 1)) | |
108 (before-and-after-compile-equal (+ 3)) | |
109 (before-and-after-compile-equal (+ simplyamarker 1)) | |
110 ;; The optimization (+ m) --> m is invalid when m is a marker. | |
111 ;; Currently the following test fails - controversial. | |
112 ;; (before-and-after-compile-equal (+ simplyamarker)) | |
113 ;; Same tests for minus. | |
114 (before-and-after-compile-equal (- 2 2)) | |
115 (before-and-after-compile-equal (- 2 1)) | |
116 (before-and-after-compile-equal (- 1 2)) | |
117 (before-and-after-compile-equal (- 1)) | |
118 (before-and-after-compile-equal (- 3)) | |
119 (before-and-after-compile-equal (- simplyamarker 1)) | |
120 (before-and-after-compile-equal (- simplyamarker)) |