Mercurial > hg > xemacs-beta
comparison tests/automated/search-tests.el @ 5041:efaa6cd845e5
add regexp-debugging
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-15 Ben Wing <ben@xemacs.org>
* regex.c:
* regex.c (DEBUG_FAIL_PRINT1):
* regex.c (PUSH_FAILURE_POINT):
* regex.c (POP_FAILURE_POINT):
* regex.c (regex_compile):
* regex.c (re_match_2_internal):
* regex.h:
* search.c:
* search.c (search_buffer):
* search.c (debug_regexps_changed):
* search.c (vars_of_search):
Add an internal variable debug_regexps and a corresponding Lisp
variable `debug-regexps' that takes a list of areas in which to
display debugging info about regex compilation and matching
(currently three areas exist). Use existing debugging code
already in regex.c and modify it so that it recognizes the
debug_regexps variable and the flags in it.
Rename variable `debug-xemacs-searches' to just `debug-searches',
consistent with other debug vars.
tests/ChangeLog addition:
2010-02-15 Ben Wing <ben@xemacs.org>
* automated/search-tests.el (let):
* automated/search-tests.el (boundp):
debug-xemacs-searches renamed to debug-searches.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 15 Feb 2010 21:51:22 -0600 |
parents | 9e7f5a77cc84 |
children | 0f66906b6e37 |
comparison
equal
deleted
inserted
replaced
5027:22179cd0fe15 | 5041:efaa6cd845e5 |
---|---|
164 (goto-char (point-min)) | 164 (goto-char (point-min)) |
165 (Assert (search-forward "Flei\xdf"))) | 165 (Assert (search-forward "Flei\xdf"))) |
166 | 166 |
167 (with-temp-buffer | 167 (with-temp-buffer |
168 (let ((target "M\xe9zard") | 168 (let ((target "M\xe9zard") |
169 (debug-xemacs-searches 1)) | 169 (debug-searches 1)) |
170 (Assert (not (search-forward target nil t))) | 170 (Assert (not (search-forward target nil t))) |
171 (insert target) | 171 (insert target) |
172 (goto-char (point-min)) | 172 (goto-char (point-min)) |
173 ;; #### search-algorithm-used is simple-search after the following, | 173 ;; #### search-algorithm-used is simple-search after the following, |
174 ;; which shouldn't be necessary; it should be possible to use | 174 ;; which shouldn't be necessary; it should be possible to use |
178 ;; use Boyer Moore with the current implementation, which is the | 178 ;; use Boyer Moore with the current implementation, which is the |
179 ;; important thing for the Gnus use case. | 179 ;; important thing for the Gnus use case. |
180 (Assert= (1+ (length target)) (search-forward target nil t)))) | 180 (Assert= (1+ (length target)) (search-forward target nil t)))) |
181 | 181 |
182 (Skip-Test-Unless | 182 (Skip-Test-Unless |
183 (boundp 'debug-xemacs-searches) ; normal when we have DEBUG_XEMACS | 183 (boundp 'debug-searches) ; normal when we have DEBUG_XEMACS |
184 "not a DEBUG_XEMACS build" | 184 "not a DEBUG_XEMACS build" |
185 "checks that the algorithm chosen by #'search-forward is relatively sane" | 185 "checks that the algorithm chosen by #'search-forward is relatively sane" |
186 (let ((debug-xemacs-searches 1) | 186 (let ((debug-searches 1) |
187 newcase) | 187 newcase) |
188 (with-temp-buffer | 188 (with-temp-buffer |
189 (insert "\n\nDer beruehmte deutsche Fleiss\n\n") | 189 (insert "\n\nDer beruehmte deutsche Fleiss\n\n") |
190 (goto-char (point-min)) | 190 (goto-char (point-min)) |
191 (Assert (search-forward "Fleiss")) | 191 (Assert (search-forward "Fleiss")) |