; * test/lisp/electric-tests.el: Reduce python-mode log spam.
This commit is contained in:
parent
fa92b040c6
commit
2902257128
1 changed files with 35 additions and 31 deletions
|
@ -54,17 +54,18 @@
|
|||
expected-point mode bindings
|
||||
fixture-fn &optional doc-string)
|
||||
(with-temp-buffer
|
||||
(funcall mode)
|
||||
(insert fixture)
|
||||
(save-electric-modes
|
||||
(let ((last-command-event char)
|
||||
(transient-mark-mode 'lambda))
|
||||
(goto-char where)
|
||||
(funcall fixture-fn)
|
||||
(cl-progv
|
||||
(mapcar #'car bindings)
|
||||
(mapcar #'cdr bindings)
|
||||
(call-interactively (key-binding `[,last-command-event])))))
|
||||
(dlet ((python-indent-guess-indent-offset-verbose nil))
|
||||
(funcall mode)
|
||||
(insert fixture)
|
||||
(save-electric-modes
|
||||
(let ((last-command-event char)
|
||||
(transient-mark-mode 'lambda))
|
||||
(goto-char where)
|
||||
(funcall fixture-fn)
|
||||
(cl-progv
|
||||
(mapcar #'car bindings)
|
||||
(mapcar #'cdr bindings)
|
||||
(call-interactively (key-binding `[,last-command-event]))))))
|
||||
(when
|
||||
(and doc-string
|
||||
(not
|
||||
|
@ -98,21 +99,22 @@
|
|||
;; FIXME: avoid `eval'
|
||||
(mapcar #'car (eval bindings))
|
||||
(mapcar #'cdr (eval bindings))
|
||||
(funcall mode)
|
||||
(insert fixture)
|
||||
(goto-char (1+ pos))
|
||||
(insert char)
|
||||
(cond ((eq (aref skip-pair-string pos)
|
||||
?p)
|
||||
(insert (cadr (electric-pair-syntax-info char)))
|
||||
(backward-char 1))
|
||||
((eq (aref skip-pair-string pos)
|
||||
?s)
|
||||
(delete-char -1)
|
||||
(forward-char 1)))
|
||||
(list
|
||||
(buffer-substring-no-properties (point-min) (point-max))
|
||||
(point))))
|
||||
(dlet ((python-indent-guess-indent-offset-verbose nil))
|
||||
(funcall mode)
|
||||
(insert fixture)
|
||||
(goto-char (1+ pos))
|
||||
(insert char)
|
||||
(cond ((eq (aref skip-pair-string pos)
|
||||
?p)
|
||||
(insert (cadr (electric-pair-syntax-info char)))
|
||||
(backward-char 1))
|
||||
((eq (aref skip-pair-string pos)
|
||||
?s)
|
||||
(delete-char -1)
|
||||
(forward-char 1)))
|
||||
(list
|
||||
(buffer-substring-no-properties (point-min) (point-max))
|
||||
(point)))))
|
||||
(list expected-string expected-point)))
|
||||
(expected-string (car expected-string-and-point))
|
||||
(expected-point (cadr expected-string-and-point))
|
||||
|
@ -191,11 +193,13 @@ The buffer's contents should %s:
|
|||
for (prefix suffix extra-desc) in
|
||||
(append (if test-in-comments
|
||||
`((,(with-temp-buffer
|
||||
(funcall mode)
|
||||
(insert "z")
|
||||
(comment-region (point-min) (point-max))
|
||||
(buffer-substring-no-properties (point-min)
|
||||
(1- (point-max))))
|
||||
(dlet ((python-indent-guess-indent-offset-verbose
|
||||
nil))
|
||||
(funcall mode)
|
||||
(insert "z")
|
||||
(comment-region (point-min) (point-max))
|
||||
(buffer-substring-no-properties (point-min)
|
||||
(1- (point-max)))))
|
||||
""
|
||||
"-in-comments")))
|
||||
(if test-in-strings
|
||||
|
|
Loading…
Add table
Reference in a new issue