Mercurial > hg > xemacs-beta
comparison tests/automated/byte-compiler-tests.el @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 74fd4e045ea6 |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
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)) |