comparison tests/automated/regexp-tests.el @ 4504:b82fdf7305ee

Correct the implementation, add a few basic tests for #'skip-chars-quote. tests/ChangeLog addition: 2008-08-27 Aidan Kehoe <kehoea@parhasard.net> * automated/regexp-tests.el: Add a few basic #'skip-chars-forward, #'skip-chars-backward tests. lisp/ChangeLog addition: 2008-08-27 Aidan Kehoe <kehoea@parhasard.net> * subr.el (skip-chars-quote): Correct the implementation, following the docstring of #'skip-char-forward more closely rather than the documentation of character classes in the Lispref.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 27 Aug 2008 21:47:21 +0200
parents 3660d327399f
children 5e8f6469169f
comparison
equal deleted inserted replaced
4503:af95657e0bfd 4504:b82fdf7305ee
520 "bar" 520 "bar"
521 " foo foo" nil nil 521 " foo foo" nil nil
522 2)) 522 2))
523 ))) 523 )))
524 524
525 ;; Not very comprehensive tests of skip-chars-forward, skip-chars-background:
526
527 (with-string-as-buffer-contents
528 "-]-----------------------------][]]------------------------"
529 (skip-chars-forward (skip-chars-quote "-[]"))
530 (Assert (= (point) (point-max)))
531 (skip-chars-backward (skip-chars-quote "-[]"))
532 (Assert (= (point) (point-min)))
533 ;; Testing in passing for an old bug in #'skip-chars-forward where I
534 ;; thought it was impossible to call it with a string containing only ?-
535 ;; and ?]:
536 (Assert (= (skip-chars-forward (skip-chars-quote "-]"))
537 (position ?[ (buffer-string) :test #'=)))
538 ;; This used to error, incorrectly:
539 (Assert (skip-chars-quote "[-")))
540
525 ;; replace-match (REPLACEMENT &optional FIXEDCASE LITERAL STRING STRBUFFER) 541 ;; replace-match (REPLACEMENT &optional FIXEDCASE LITERAL STRING STRBUFFER)
526 542
527 ;; #### Write some tests! Much functionality is implicitly tested above 543 ;; #### Write some tests! Much functionality is implicitly tested above
528 ;; via `replace-regexp-in-string', but we should specifically test bogus 544 ;; via `replace-regexp-in-string', but we should specifically test bogus
529 ;; combinations of STRING and STRBUFFER. 545 ;; combinations of STRING and STRBUFFER.