X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tests%2Fautomated%2Fsyntax-tests.el;h=62e2978771a1de0bb992dc66a0099abc5f5d3f70;hb=b931681a08f642b200bc3ab09cf6490167654ce9;hp=1ebb9f18e1b5a6d130162bad6d870ef7b5cd4f8a;hpb=a5812bf2ff9a9cf40f4ff78dcb83f5b4c295bd18;p=chise%2Fxemacs-chise.git diff --git a/tests/automated/syntax-tests.el b/tests/automated/syntax-tests.el index 1ebb9f1..62e2978 100644 --- a/tests/automated/syntax-tests.el +++ b/tests/automated/syntax-tests.el @@ -155,3 +155,42 @@ ;; this last used to crash (parse-partial-sexp point (point-max))))) + +;; Test backward-up-list +;; Known-Bug: report = Evgeny Zacjev ca 2005-12-01, confirm = Aidan Kehoe + +(with-temp-buffer + ;; We are now using the standard syntax table. Thus there's no need to + ;; worry about a bogus syntax setting, eg, in a Gnus Article buffer the + ;; bug doesn't manifest. + + ;; value of point to the immediate left of this character + ;; 0 1 2 + ;; 1234 56789 012 34567 890 12 3456 7 + (insert "a ( \"b (c\" (\"defg\") \")\") h\n") + + ;; #### This test should check *every* position. + (flet ((backward-up-list-moves-point-from-to (start expected-end) + (goto-char start) + (backward-up-list 1) + (= (point) expected-end))) + (Known-Bug-Expect-Failure + ;; Evgeny's case + (Assert (backward-up-list-moves-point-from-to 16 12))) + (Assert (backward-up-list-moves-point-from-to 19 12)) + (Assert (backward-up-list-moves-point-from-to 20 3)) + (Known-Bug-Expect-Failure + (Assert (backward-up-list-moves-point-from-to 22 3))) + (Known-Bug-Expect-Failure + (Assert (backward-up-list-moves-point-from-to 23 3))) + (Assert (backward-up-list-moves-point-from-to 24 3)) + ;; This is maybe a little tricky, since we don't expect the position + ;; check to happen -- so use an illegal expected position + ;; I don't think there's any other way for this to fail that way, + ;; barring hardware error.... + (Check-Error-Message syntax-error + "Unbalanced parentheses" + (backward-up-list-moves-point-from-to 25 nil)) + ;; special-case check that point didn't move + (Assert (= (point) 25)))) +