comparison tests/automated/syntax-tests.el @ 3130:a7ef4b25b467

[xemacs-hg @ 2005-12-08 10:58:57 by stephent] Tests for backward-up-list. <87oe3rg8l1.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 08 Dec 2005 10:58:59 +0000
parents 0d33547d9ed3
children 4035bd42c75e
comparison
equal deleted inserted replaced
3129:17d3297c6bad 3130:a7ef4b25b467
148 (forward-comment 2) 148 (forward-comment 2)
149 (Assert (eq (point) (point-max))) 149 (Assert (eq (point) (point-max)))
150 150
151 ;; this last used to crash 151 ;; this last used to crash
152 (parse-partial-sexp point (point-max))))) 152 (parse-partial-sexp point (point-max)))))
153
154 ;; Test backward-up-list
155 ;; Known-Bug: report = Evgeny Zacjev ca 2005-12-01, confirm = Aidan Kehoe
156
157 (with-temp-buffer
158 ;; We are now using the standard syntax table. Thus there's no need to
159 ;; worry about a bogus syntax setting, eg, in a Gnus Article buffer the
160 ;; bug doesn't manifest.
161
162 ;; value of point to the immediate left of this character
163 ;; 0 1 2
164 ;; 1234 56789 012 34567 890 12 3456 7
165 (insert "a ( \"b (c\" (\"defg\") \")\") h\n")
166
167 ;; #### This test should check *every* position.
168 (flet ((backward-up-list-moves-point-from-to (start expected-end)
169 (goto-char start)
170 (backward-up-list 1)
171 (= (point) expected-end)))
172 (Known-Bug-Expect-Failure
173 ;; Evgeny's case
174 (Assert (backward-up-list-moves-point-from-to 16 12)))
175 (Assert (backward-up-list-moves-point-from-to 19 12))
176 (Assert (backward-up-list-moves-point-from-to 20 3))
177 (Known-Bug-Expect-Failure
178 (Assert (backward-up-list-moves-point-from-to 22 3)))
179 (Known-Bug-Expect-Failure
180 (Assert (backward-up-list-moves-point-from-to 23 3)))
181 (Assert (backward-up-list-moves-point-from-to 24 3))
182 ;; This is maybe a little tricky, since we don't expect the position
183 ;; check to happen -- so use an illegal expected position
184 ;; I don't think there's any other way for this to fail that way,
185 ;; barring hardware error....
186 (Check-Error-Message syntax-error
187 "Unbalanced parentheses"
188 (backward-up-list-moves-point-from-to 25 nil))
189 ;; special-case check that point didn't move
190 (Assert (= (point) 25))))
191