comparison tests/automated/syntax-tests.el @ 5136:0f66906b6e37

Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-03-12 Ben Wing <ben@xemacs.org> * test-harness.el (test-harness-from-buffer): Undo change of e.g. (Assert (equalp ...)) to (Assert-equalp ...). Get rid of `Assert-equalp' and friends, `Assert-test', and `Assert-test-not'. Instead, make `Assert' smart enough to do the equivalent functionality when an expression like (Assert (equalp ...)) is seen. tests/ChangeLog addition: 2010-03-12 Ben Wing <ben@xemacs.org> * automated/base64-tests.el (bt-base64-encode-string): * automated/base64-tests.el (bt-base64-decode-string): * automated/base64-tests.el (for): * automated/byte-compiler-tests.el: * automated/byte-compiler-tests.el (before-and-after-compile-equal): * automated/case-tests.el (downcase-string): * automated/case-tests.el (uni-mappings): * automated/ccl-tests.el (ccl-test-normal-expr): * automated/ccl-tests.el (ccl-test-map-instructions): * automated/ccl-tests.el (ccl-test-suites): * automated/database-tests.el (delete-database-files): * automated/extent-tests.el (let): * automated/extent-tests.el (insert): * automated/extent-tests.el (props): * automated/file-tests.el: * automated/file-tests.el (for): * automated/hash-table-tests.el (test): * automated/hash-table-tests.el (for): * automated/hash-table-tests.el (ht): * automated/hash-table-tests.el (iterations): * automated/hash-table-tests.el (h1): * automated/hash-table-tests.el (equal): * automated/hash-table-tests.el (=): * automated/lisp-tests.el: * automated/lisp-tests.el (eq): * automated/lisp-tests.el (test-setq): * automated/lisp-tests.el (my-vector): * automated/lisp-tests.el (x): * automated/lisp-tests.el (equal): * automated/lisp-tests.el (y): * automated/lisp-tests.el (featurep): * automated/lisp-tests.el (=): * automated/lisp-tests.el (six): * automated/lisp-tests.el (three): * automated/lisp-tests.el (one): * automated/lisp-tests.el (two): * automated/lisp-tests.el (five): * automated/lisp-tests.el (test1): * automated/lisp-tests.el (division-test): * automated/lisp-tests.el (for): * automated/lisp-tests.el (check-function-argcounts): * automated/lisp-tests.el (z): * automated/lisp-tests.el (eql): * automated/lisp-tests.el (test-harness-risk-infloops): * automated/lisp-tests.el (erase-buffer): * automated/lisp-tests.el (sym): * automated/lisp-tests.el (new-char): * automated/lisp-tests.el (new-load-file-name): * automated/lisp-tests.el (cl-floor): * automated/lisp-tests.el (foo): * automated/md5-tests.el (lambda): * automated/md5-tests.el (large-string): * automated/md5-tests.el (mapcar): * automated/md5-tests.el (insert): * automated/mule-tests.el: * automated/mule-tests.el (test-chars): * automated/mule-tests.el (existing-file-name): * automated/mule-tests.el (featurep): * automated/query-coding-tests.el (featurep): * automated/regexp-tests.el: * automated/regexp-tests.el (insert): * automated/regexp-tests.el (Assert): * automated/regexp-tests.el (=): * automated/regexp-tests.el (featurep): * automated/regexp-tests.el (text): * automated/regexp-tests.el (text1): * automated/regexp-tests.el ("aáa"): * automated/regexp-tests.el (eql): * automated/search-tests.el (insert): * automated/search-tests.el (featurep): * automated/search-tests.el (let): * automated/search-tests.el (boundp): * automated/symbol-tests.el: * automated/symbol-tests.el (name): * automated/symbol-tests.el (check-weak-list-unique): * automated/symbol-tests.el (string): * automated/symbol-tests.el (list): * automated/symbol-tests.el (foo): * automated/symbol-tests.el (eq): * automated/symbol-tests.el (fresh-keyword-name): * automated/symbol-tests.el (print-gensym): * automated/symbol-tests.el (mysym): * automated/syntax-tests.el (test-forward-word): * automated/syntax-tests.el (test-backward-word): * automated/syntax-tests.el (test-syntax-table): * automated/syntax-tests.el (with-syntax-table): * automated/syntax-tests.el (Skip-Test-Unless): * automated/syntax-tests.el (with): * automated/tag-tests.el (testfile): * automated/weak-tests.el (w): * automated/weak-tests.el (p): * automated/weak-tests.el (a): Undo change of e.g. (Assert (equalp ...)) to (Assert-equalp ...). Get rid of `Assert-equalp' and friends, `Assert-test', and `Assert-test-not'. Instead, make `Assert' smart enough to do the equivalent functionality when an expression like (Assert (equalp ...)) is seen.
author Ben Wing <ben@xemacs.org>
date Fri, 12 Mar 2010 18:27:51 -0600
parents 133e816778ed
children 308d34e9f07d
comparison
equal deleted inserted replaced
5113:b2dcf6a6d8ab 5136:0f66906b6e37
47 (goto-char (point-max)) 47 (goto-char (point-max))
48 (let ((point (point))) 48 (let ((point (point)))
49 (insert string) 49 (insert string)
50 (goto-char point) 50 (goto-char point)
51 (forward-word 1) 51 (forward-word 1)
52 (Assert-eq (point) (+ point stop)))) 52 (Assert (eq (point) (+ point stop)))))
53 53
54 (with-temp-buffer 54 (with-temp-buffer
55 ;; -!- W NW 55 ;; -!- W NW
56 (test-forward-word "W " 1) 56 (test-forward-word "W " 1)
57 (test-forward-word "WO " 2) 57 (test-forward-word "WO " 2)
75 (defun test-backward-word (string stop) 75 (defun test-backward-word (string stop)
76 (goto-char (point-min)) 76 (goto-char (point-min))
77 (insert string) 77 (insert string)
78 (let ((point (point))) 78 (let ((point (point)))
79 (backward-word 1) 79 (backward-word 1)
80 (Assert-eq (point) (- point stop)))) 80 (Assert (eq (point) (- point stop)))))
81 81
82 (with-temp-buffer 82 (with-temp-buffer
83 ;; NW W -!- 83 ;; NW W -!-
84 (test-backward-word " W" 1) 84 (test-backward-word " W" 1)
85 (test-backward-word " WO" 2) 85 (test-backward-word " WO" 2)
118 (insert string) 118 (insert string)
119 (put-text-property (+ point (car apply-pos)) (+ point (cdr apply-pos)) 119 (put-text-property (+ point (car apply-pos)) (+ point (cdr apply-pos))
120 'syntax-table apply-syntax) 120 'syntax-table apply-syntax)
121 (goto-char point) 121 (goto-char point)
122 (forward-word 1) 122 (forward-word 1)
123 (Assert-eq (point) (+ point stop))))) 123 (Assert (eq (point) (+ point stop))))))
124 124
125 ;; test syntax-table extents 125 ;; test syntax-table extents
126 (with-temp-buffer 126 (with-temp-buffer
127 ;; Apply punctuation to word 127 ;; Apply punctuation to word
128 (test-syntax-table "WO" 1 `(,(syntax-string-to-code ".")) 1) 128 (test-syntax-table "WO" 1 `(,(syntax-string-to-code ".")) 1)
141 ;; Fixed 2007-03-25 Olivier Galibert <20070324221053.GA48218@dspnet.fr.eu.org> 141 ;; Fixed 2007-03-25 Olivier Galibert <20070324221053.GA48218@dspnet.fr.eu.org>
142 (with-temp-buffer 142 (with-temp-buffer
143 (with-syntax-table (make-syntax-table) 143 (with-syntax-table (make-syntax-table)
144 (insert "foo bar") 144 (insert "foo bar")
145 (backward-sexp 1) 145 (backward-sexp 1)
146 (Assert-eql (point) 5))) 146 (Assert (eql (point) 5))))
147 147
148 ;; Test forward-comment at buffer boundaries 148 ;; Test forward-comment at buffer boundaries
149 ;; #### The second Assert fails (once interpreted, once compiled) on 21.4.9 149 ;; #### The second Assert fails (once interpreted, once compiled) on 21.4.9
150 ;; with sjt's version of Andy's syntax-text-property-killer patch. 150 ;; with sjt's version of Andy's syntax-text-property-killer patch.
151 (with-temp-buffer 151 (with-temp-buffer
154 "comment and parse-partial-sexp tests" 154 "comment and parse-partial-sexp tests"
155 (c-mode) 155 (c-mode)
156 156
157 (insert "// comment\n") 157 (insert "// comment\n")
158 (forward-comment -2) 158 (forward-comment -2)
159 (Assert-eq (point) (point-min)) 159 (Assert (eq (point) (point-min)))
160 160
161 (let ((point (point))) 161 (let ((point (point)))
162 (insert "/* comment */") 162 (insert "/* comment */")
163 (goto-char point) 163 (goto-char point)
164 (forward-comment 2) 164 (forward-comment 2)
165 (Assert-eq (point) (point-max)) 165 (Assert (eq (point) (point-max)))
166 166
167 ;; this last used to crash 167 ;; this last used to crash
168 (parse-partial-sexp point (point-max))))) 168 (parse-partial-sexp point (point-max)))))
169 169
170 ;; Test backward-up-list 170 ;; Test backward-up-list
202 ;; barring hardware error.... 202 ;; barring hardware error....
203 (Check-Error-Message syntax-error 203 (Check-Error-Message syntax-error
204 "Unbalanced parentheses" 204 "Unbalanced parentheses"
205 (backward-up-list-moves-point-from-to 25 nil)) 205 (backward-up-list-moves-point-from-to 25 nil))
206 ;; special-case check that point didn't move 206 ;; special-case check that point didn't move
207 (Assert= (point) 25))) 207 (Assert (= (point) 25))))
208 208
209 (loop 209 (loop
210 with envvar-not-existing = (symbol-name (gensym "whatever")) 210 with envvar-not-existing = (symbol-name (gensym "whatever"))
211 with envvar-existing = (symbol-name (gensym "whatever")) 211 with envvar-existing = (symbol-name (gensym "whatever"))
212 with envvar-existing-val = (make-string #x10000 ?\xe1) 212 with envvar-existing-val = (make-string #x10000 ?\xe1)