summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2022-08-21 17:33:55 +0200
committerStefan Kangas <stefankangas@gmail.com>2022-08-21 17:45:04 +0200
commit85480527d571640a027343d3a145b1cbfcfe8c11 (patch)
tree5f3524dbbbe878f087e8a751142860a9fac45a1e /test/lisp
parent79560aaa51adaa0ec60b3faa68bef4e8167a146f (diff)
downloademacs-85480527d571640a027343d3a145b1cbfcfe8c11.tar.gz
emacs-85480527d571640a027343d3a145b1cbfcfe8c11.tar.bz2
emacs-85480527d571640a027343d3a145b1cbfcfe8c11.zip
Prefer pos-bol and pos-eol in tests
* test/lisp/calendar/todo-mode-tests.el (todo-test-toggle-item-header02, todo-test-edit-item-date-month) (todo-test-multiline-item-indentation-1) (todo-test-multiline-item-indentation-2) (todo-test-multiline-item-indentation-3): * test/lisp/cedet/semantic-utest-ia.el (semantic-ia-utest-buffer) (semantic-sr-utest-buffer-refs): * test/lisp/cedet/semantic-utest.el (semantic-utest-kill-indicator) (semantic-utest-unkill-indicator): * test/lisp/dired-tests.el (dired-test-bug27968): * test/lisp/emacs-lisp/backtrace-tests.el (backtrace-tests--verify-single-and-multi-line): * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--find-library-verbose): * test/lisp/erc/erc-tests.el (erc-ring-previous-command) (erc-log-irc-protocol): * test/lisp/gnus/message-tests.el (message-mode-propertize): * test/lisp/info-xref-tests.el (info-xref-test-emacs-manuals): * test/lisp/mail/footnote-tests.el (footnote-tests-same-place): * test/lisp/progmodes/elisp-mode-tests.el (elisp-shorthand-completion-at-point): * test/lisp/progmodes/f90-tests.el (f90-test-bug38415): * test/lisp/progmodes/python-tests.el (python-indent-electric-comma-inside-multiline-string) (python-indent-electric-comma-after-multiline-string) (python-indent-electric-colon-1, python-indent-electric-colon-2) (python-indent-electric-colon-3, python-indent-electric-colon-4) (python-mark-defun-2, python-mark-defun-3, python-mark-defun-4) (python-mark-defun-5, python-nav-end-of-defun-2) (python-nav-end-of-statement-1, python-nav-end-of-block-1) (python-indent-dedent-line-backspace-2) (python-indent-dedent-line-backspace-3) (python-eldoc--get-symbol-at-point-1) (python-info-beginning-of-statement-p-1) (python-info-beginning-of-statement-p-2): * test/lisp/replace-tests.el (replace-occur-revert-bug32543) (replace-occur-revert-bug32987): * test/lisp/simple-tests.el (simple-delete-indentation-boundaries) (simple-delete-indentation-region) (line-number-at-pos-in-narrow-buffer) (line-number-at-pos-keeps-restriction): * test/lisp/textmodes/css-mode-tests.el (css-mode-test-selectors) (scss-mode-test-selectors): * test/lisp/textmodes/fill-tests.el (fill-test-unbreakable-paragraph) (fill-test-breakable-paragraph): * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): * test/src/lread-tests.el (lread-tests--last-message): * test/src/process-tests.el (set-process-filter-t): * test/src/undo-tests.el (undo-test-skip-invalidated-markers): Prefer pos-bol and pos-eol.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/calendar/todo-mode-tests.el10
-rw-r--r--test/lisp/cedet/semantic-utest-ia.el12
-rw-r--r--test/lisp/cedet/semantic-utest.el6
-rw-r--r--test/lisp/dired-tests.el4
-rw-r--r--test/lisp/emacs-lisp/backtrace-tests.el6
-rw-r--r--test/lisp/emacs-lisp/find-func-tests.el4
-rw-r--r--test/lisp/erc/erc-tests.el12
-rw-r--r--test/lisp/gnus/message-tests.el8
-rw-r--r--test/lisp/info-xref-tests.el3
-rw-r--r--test/lisp/mail/footnote-tests.el2
-rw-r--r--test/lisp/progmodes/elisp-mode-tests.el2
-rw-r--r--test/lisp/progmodes/f90-tests.el4
-rw-r--r--test/lisp/progmodes/python-tests.el60
-rw-r--r--test/lisp/replace-tests.el4
-rw-r--r--test/lisp/simple-tests.el20
-rw-r--r--test/lisp/textmodes/css-mode-tests.el8
-rw-r--r--test/lisp/textmodes/fill-tests.el8
-rw-r--r--test/lisp/time-stamp-tests.el6
18 files changed, 83 insertions, 96 deletions
diff --git a/test/lisp/calendar/todo-mode-tests.el b/test/lisp/calendar/todo-mode-tests.el
index 0102b62c10f..95855d1e639 100644
--- a/test/lisp/calendar/todo-mode-tests.el
+++ b/test/lisp/calendar/todo-mode-tests.el
@@ -459,7 +459,7 @@ the top done item should be the first done item."
todo-date-pattern
"\\( " diary-time-regexp "\\)?"
(regexp-quote todo-nondiary-end) "?")
- (line-end-position) t)
+ (pos-eol) t)
(forward-char)
(point)))
(start1 (save-excursion (funcall find-start)))
@@ -854,7 +854,7 @@ item's date should be adjusted accordingly."
(let ((current-prefix-arg t) ; For todo-edit-item--header.
(get-date (lambda ()
(save-excursion
- (todo-date-string-matcher (line-end-position))
+ (todo-date-string-matcher (pos-eol))
(buffer-substring-no-properties (match-beginning 1)
(match-end 0))))))
(should (equal (funcall get-date) "Jan 1, 2020"))
@@ -903,7 +903,7 @@ tab character."
(todo-test--insert-item item 1)
(re-search-forward (concat todo-date-string-start todo-date-pattern
(regexp-quote todo-nondiary-end) " ")
- (line-end-position) t)
+ (pos-eol) t)
(should (looking-at (regexp-quote (concat item0 "\n\t" item1)))))))
(ert-deftest todo-test-multiline-item-indentation-2 () ; bug#43068
@@ -917,7 +917,7 @@ begin with a tab character."
(todo-edit-item--text 'multiline)
(insert (concat "\n" item1))
(todo-edit-quit)
- (goto-char (line-beginning-position))
+ (goto-char (pos-bol))
(should (looking-at (regexp-quote (concat item0 "\n\t" item1)))))))
(ert-deftest todo-test-multiline-item-indentation-3 ()
@@ -930,7 +930,7 @@ since all non-initial item lines must begin with whitespace."
(item1 "Second line."))
(todo-edit-file)
(should (looking-at (regexp-quote item0)))
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(insert (concat "\n" item1))
(should-error (todo-edit-quit) :type 'user-error))))
diff --git a/test/lisp/cedet/semantic-utest-ia.el b/test/lisp/cedet/semantic-utest-ia.el
index caf20fa8e07..fa3b3185ed5 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -194,7 +194,7 @@
(goto-char a)
- (let ((bss (buffer-substring-no-properties (point) (point-at-eol))))
+ (let ((bss (buffer-substring-no-properties (point) (pos-eol))))
(condition-case nil
(setq desired (read bss))
(error (setq desired (format " FAILED TO PARSE: %S"
@@ -215,8 +215,8 @@
)
fail)))
- (setq p nil a nil)
- (setq idx (1+ idx)))
+ (setq p nil a nil)
+ (setq idx (1+ idx)))
)
(when fail
@@ -353,7 +353,7 @@
(when (re-search-forward regex-p nil t)
(setq tag (semantic-current-tag))
(goto-char (match-end 0))
- (setq desired (read (buffer-substring (point) (point-at-eol))))
+ (setq desired (read (buffer-substring (point) (pos-eol))))
))
tag)
@@ -451,7 +451,7 @@ tag that contains point, and return that."
(when (re-search-forward regex-p nil t)
(goto-char (match-end 0))
(skip-syntax-backward "w")
- (setq desired (read (buffer-substring (point) (point-at-eol))))
+ (setq desired (read (buffer-substring (point) (pos-eol))))
(setq start (match-beginning 0))
(goto-char start)
(setq actual (semantic-symref-test-count-hits-in-tag))
@@ -463,7 +463,7 @@ tag that contains point, and return that."
(list
(format
"Symref id %d: No results." idx))
- fail))
+ fail))
)
diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el
index 78bbbbf4592..24a467474b9 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -736,8 +736,8 @@ JAVE this thing would need to be recursive to handle java and csharp"
(beginning-of-line)
(setq semantic-utest-last-kill-pos (point))
(setq semantic-utest-last-kill-text
- (buffer-substring (point) (point-at-eol)))
- (delete-region (point) (point-at-eol))
+ (buffer-substring (point) (pos-eol)))
+ (delete-region (point) (pos-eol))
(insert insertme)
(sit-for 0)
)
@@ -745,7 +745,7 @@ JAVE this thing would need to be recursive to handle java and csharp"
(defun semantic-utest-unkill-indicator ()
"Unkill the last indicator."
(goto-char semantic-utest-last-kill-pos)
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (pos-eol))
(insert semantic-utest-last-kill-text)
(sit-for 0)
)
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el
index 0e893259077..9cf01519052 100644
--- a/test/lisp/dired-tests.el
+++ b/test/lisp/dired-tests.el
@@ -313,7 +313,7 @@
(save-excursion
(goto-char 1)
(forward-line 1)
- (- (point-at-eol) (point)))))
+ (- (pos-eol) (point)))))
orig-len len diff pos line-nb)
(make-directory subdir 'parents)
(with-current-buffer (dired-noselect subdir)
@@ -331,7 +331,7 @@
(forward-line 1)
(let ((inhibit-read-only t)
(new-header " test-bug27968"))
- (delete-region (point) (point-at-eol))
+ (delete-region (point) (pos-eol))
(when (= orig-len (length new-header))
;; Wow lucky guy! I must buy lottery today.
(setq new-header (concat new-header " :-)")))
diff --git a/test/lisp/emacs-lisp/backtrace-tests.el b/test/lisp/emacs-lisp/backtrace-tests.el
index b08695a22bb..b42de06776b 100644
--- a/test/lisp/emacs-lisp/backtrace-tests.el
+++ b/test/lisp/emacs-lisp/backtrace-tests.el
@@ -274,16 +274,16 @@ line contains the strings \"lambda\" and \"number\"."
;; Verify the form now spans multiple lines.
(let ((pos (point)))
(search-forward "number")
- (should-not (= pos (point-at-bol))))
+ (should-not (= pos (pos-bol))))
;; Collapse the form.
(backtrace-single-line)
;; Verify that the form is now back on one line,
;; and that point is at the same place.
(should (string= (backtrace-tests--get-substring
(- (point) 6) (point)) "number"))
- (should-not (= (point) (point-at-bol)))
+ (should-not (= (point) (pos-bol)))
(should (string= (backtrace-tests--get-substring
- (point-at-bol) (1+ (point-at-eol)))
+ (pos-bol) (1+ (pos-eol)))
line)))
(ert-deftest backtrace-tests--print-circle ()
diff --git a/test/lisp/emacs-lisp/find-func-tests.el b/test/lisp/emacs-lisp/find-func-tests.el
index 420c61acb55..d18a9dc1a94 100644
--- a/test/lisp/emacs-lisp/find-func-tests.el
+++ b/test/lisp/emacs-lisp/find-func-tests.el
@@ -109,9 +109,7 @@ expected function symbol and function library, respectively."
(skip-chars-backward "\n")
(should (string-match-p
".join-line. is an alias for .delete-indentation."
- (buffer-substring
- (line-beginning-position)
- (point)))))))
+ (buffer-substring (pos-bol) (point)))))))
;; Avoid a byte-compilation warning that may confuse people reading
;; the result of the following test.
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 0f222edacfa..55efe2fd2d9 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -522,7 +522,7 @@
(erc-send-current-line)
(should (ring-p erc-input-ring))
(should (zerop (ring-member erc-input-ring "/one"))) ; equal
- (should (save-excursion (forward-line -1) (goto-char (point-at-bol))
+ (should (save-excursion (forward-line -1) (goto-char (pos-bol))
(looking-at-p "[*]+ echo: one")))
(should-not erc-input-ring-index)
(erc-bol)
@@ -575,15 +575,15 @@
(goto-char (point-min))
(search-forward "Version")
(search-forward "\r\n\r\n")
- (search-forward "myproxy.localhost:6667 >> PASS" (line-end-position))
+ (search-forward "myproxy.localhost:6667 >> PASS" (pos-eol))
(forward-line)
- (search-forward "irc.gnu.org << :irc.gnu.org 001" (line-end-position))
+ (search-forward "irc.gnu.org << :irc.gnu.org 001" (pos-eol))
(forward-line)
- (search-forward "irc.gnu.org << :irc.gnu.org 002" (line-end-position))
+ (search-forward "irc.gnu.org << :irc.gnu.org 002" (pos-eol))
(forward-line)
- (search-forward "FooNet << :irc.gnu.org 422" (line-end-position))
+ (search-forward "FooNet << :irc.gnu.org 422" (pos-eol))
(forward-line)
- (search-forward "BarNet << :irc.gnu.org 221" (line-end-position)))
+ (search-forward "BarNet << :irc.gnu.org 221" (pos-eol)))
(when noninteractive
(kill-buffer "*erc-protocol*")
(should-not erc-debug-irc-protocol)))
diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el
index 8f3c1250a9e..a724428ecb4 100644
--- a/test/lisp/gnus/message-tests.el
+++ b/test/lisp/gnus/message-tests.el
@@ -47,14 +47,10 @@
(setq-local parse-sexp-lookup-properties t)
(backward-sexp)
(should (string= "here's an opener "
- (buffer-substring-no-properties
- (line-beginning-position)
- (point))))
+ (buffer-substring-no-properties (pos-bol) (point))))
(forward-sexp)
(should (string= "and here's a closer )"
- (buffer-substring-no-properties
- (line-beginning-position)
- (point)))))
+ (buffer-substring-no-properties (pos-bol) (point)))))
(set-buffer-modified-p nil))))
diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el
index acfd6e82f16..117170ba338 100644
--- a/test/lisp/info-xref-tests.el
+++ b/test/lisp/info-xref-tests.el
@@ -161,8 +161,7 @@ text.
(should (search-backward "done" nil t))
(should (string-match-p
" [0-9]\\{3,\\} good, 0 bad"
- (buffer-substring-no-properties (line-beginning-position)
- (line-end-position)))))))
+ (buffer-substring-no-properties (pos-bol) (pos-eol)))))))
;;; info-xref-tests.el ends here
diff --git a/test/lisp/mail/footnote-tests.el b/test/lisp/mail/footnote-tests.el
index e33b59bc416..f3a35e3dfc6 100644
--- a/test/lisp/mail/footnote-tests.el
+++ b/test/lisp/mail/footnote-tests.el
@@ -40,7 +40,7 @@
(footnote-back-to-message)
(should (equal (buffer-substring (point-min) (point))
"hello[1]"))
- (should (equal (buffer-substring (point-min) (line-end-position))
+ (should (equal (buffer-substring (point-min) (pos-eol))
"hello[1][2] world"))))
(provide 'footnote-tests)
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el
index 8e4dfa8bb83..8074d8d7066 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -1084,7 +1084,7 @@ evaluation of BODY."
(insert "f-test-compl")
(completion-at-point)
(goto-char (point-min))
- (should (search-forward "f-test-complete-me" (line-end-position) t))
+ (should (search-forward "f-test-complete-me" (pos-eol) t))
(goto-char (point-min))
(should (string= (symbol-name (read (current-buffer)))
"elisp--foo-test-complete-me"))
diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el
index 3fe5eecd1b2..b857a25bf2a 100644
--- a/test/lisp/progmodes/f90-tests.el
+++ b/test/lisp/progmodes/f90-tests.el
@@ -285,14 +285,14 @@ real :: x
end")
(f90-indent-line)
(should (equal " function foo"
- (buffer-substring (point) (line-end-position))))
+ (buffer-substring (point) (pos-eol))))
(goto-char (point-max))
(insert "\nmodule subroutine bar(x)
real :: x
end")
(f90-indent-line)
(should (equal " subroutine bar"
- (buffer-substring (point) (line-end-position))))))
+ (buffer-substring (point) (pos-eol))))))
;;; f90-tests.el ends here
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index a11716a7b53..12ac871fdf8 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -1639,7 +1639,7 @@ a = (
"
(python-tests-look-at "- bar")
(should (eq (car (python-indent-context)) :inside-string))
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ",")
(should (= (current-indentation) 0))))
@@ -1654,7 +1654,7 @@ a = (
"
(python-tests-look-at "- bar'''")
(should (eq (car (python-indent-context)) :inside-string))
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ",")
(should (= (current-indentation) 0))))
@@ -1668,7 +1668,7 @@ def a():
def b()
"
(python-tests-look-at "def b()")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ":")
(should (= (current-indentation) 0))))
@@ -1682,7 +1682,7 @@ if do:
outside
"
(python-tests-look-at "else")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ":")
(should (= (current-indentation) 0))
(python-tests-look-at "outside")
@@ -1699,7 +1699,7 @@ if do:
that)
"
(python-tests-look-at "that)")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ":")
(python-tests-look-at "elif" -1)
(should (= (current-indentation) 0))
@@ -1724,7 +1724,7 @@ def f():
else
"
(python-tests-look-at "else")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(python-tests-self-insert ":")
(python-tests-look-at "else" -1)
(should (= (current-indentation) 4))))
@@ -1984,7 +1984,7 @@ class C:
(expected-mark-beginning-position
(progn
(python-tests-look-at "def __init__(self):")
- (1- (line-beginning-position))))
+ (1- (pos-bol))))
(expected-mark-end-position-1
(save-excursion
(python-tests-look-at "self.b = 'b'")
@@ -2041,7 +2041,7 @@ class C:
(progn
(python-tests-look-at "def fun(self):")
(python-tests-look-at "(self):")
- (1- (line-beginning-position))))
+ (1- (pos-bol))))
(expected-mark-end-position
(save-excursion
(python-tests-look-at "return self.b")
@@ -2066,7 +2066,7 @@ def foo(x):
(let ((expected-mark-beginning-position
(progn
(python-tests-look-at "def foo(x):")
- (1- (line-beginning-position))))
+ (1- (pos-bol))))
(expected-mark-end-position (point-max)))
(python-tests-look-at "return bar")
(python-mark-defun 1)
@@ -2086,7 +2086,7 @@ def \\
(expected-mark-beginning-position
(progn
(python-tests-look-at "def ")
- (1- (line-beginning-position))))
+ (1- (pos-bol))))
(expected-mark-end-position
(save-excursion
(python-tests-look-at "return x")
@@ -2438,21 +2438,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
(point))
(save-excursion
(python-tests-look-at "return wwrap")
- (line-beginning-position))))
+ (pos-bol))))
(should (= (save-excursion
(python-tests-look-at "def wrapped_f(*args):")
(python-nav-end-of-defun)
(point))
(save-excursion
(python-tests-look-at "return wrapped_f")
- (line-beginning-position))))
+ (pos-bol))))
(should (= (save-excursion
(python-tests-look-at "f(*args)")
(python-nav-end-of-defun)
(point))
(save-excursion
(python-tests-look-at "return wrapped_f")
- (line-beginning-position))))))
+ (pos-bol))))))
(ert-deftest python-nav-end-of-defun-3 ()
(python-tests-with-temp-buffer
@@ -2765,14 +2765,14 @@ string
(point))
(save-excursion
(python-tests-look-at "789")
- (line-end-position))))
+ (pos-eol))))
(python-tests-look-at "v2 =")
(should (= (save-excursion
(python-nav-end-of-statement)
(point))
(save-excursion
(python-tests-look-at "value4)")
- (line-end-position))))
+ (pos-eol))))
(python-tests-look-at "v3 =")
(should (= (save-excursion
(python-nav-end-of-statement)
@@ -2780,7 +2780,7 @@ string
(save-excursion
(python-tests-look-at
"'continue previous line')")
- (line-end-position))))
+ (pos-eol))))
(python-tests-look-at "v4 =")
(should (= (save-excursion
(python-nav-end-of-statement)
@@ -3004,21 +3004,21 @@ def decoratorFunctionWithArguments(arg1, arg2, arg3):
(point))
(save-excursion
(python-tests-look-at "return wrapped_f")
- (line-end-position))))
+ (pos-eol))))
(end-of-line)
(should (= (save-excursion
(python-nav-end-of-block)
(point))
(save-excursion
(python-tests-look-at "return wrapped_f")
- (line-end-position))))
+ (pos-eol))))
(python-tests-look-at "f(*args)")
(should (= (save-excursion
(python-nav-end-of-block)
(point))
(save-excursion
(python-tests-look-at "print 'After f(*args)'")
- (line-end-position))))))
+ (pos-eol))))))
(ert-deftest python-nav-end-of-block-2 ()
"Ensure that `python-nav-end-of-block' does not enter an infinite loop."
@@ -3308,11 +3308,11 @@ if x:
\tabcdefg
"
(python-tests-look-at "abcdefg")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(call-interactively #'python-indent-dedent-line-backspace)
(should
(string= (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))
+ (pos-bol) (pos-eol))
"\tabcdef")))))
(ert-deftest python-indent-dedent-line-backspace-3 ()
@@ -3325,27 +3325,27 @@ if x:
\t abcdefg
"
(python-tests-look-at "abcdefg")
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(call-interactively #'python-indent-dedent-line-backspace)
(should
(string= (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))
+ (pos-bol) (pos-eol))
"\t abcdef"))
(back-to-indentation)
(call-interactively #'python-indent-dedent-line-backspace)
(should
(string= (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))
+ (pos-bol) (pos-eol))
"\tabcdef"))
(call-interactively #'python-indent-dedent-line-backspace)
(should
(string= (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))
+ (pos-bol) (pos-eol))
" abcdef"))
(call-interactively #'python-indent-dedent-line-backspace)
(should
(string= (buffer-substring-no-properties
- (line-beginning-position) (line-end-position))
+ (pos-bol) (pos-eol))
"abcdef")))))
(ert-deftest python-bob-infloop-avoid ()
@@ -4358,11 +4358,11 @@ map(codecs.open('somefile'
"
(python-tests-look-at "ap(xx")
(should (string= (python-eldoc--get-symbol-at-point) "map"))
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(should (string= (python-eldoc--get-symbol-at-point) "map"))
(python-tests-look-at "('somefile'")
(should (string= (python-eldoc--get-symbol-at-point) "map"))
- (goto-char (line-end-position))
+ (goto-char (pos-eol))
(should (string= (python-eldoc--get-symbol-at-point) "codecs.open"))))
(ert-deftest python-eldoc--get-symbol-at-point-2 ()
@@ -4875,7 +4875,7 @@ def long_function_name(
(should (not (python-info-beginning-of-statement-p)))
(python-tests-look-at "print (var_one)")
(should (python-info-beginning-of-statement-p))
- (goto-char (line-beginning-position))
+ (goto-char (pos-bol))
(should (not (python-info-beginning-of-statement-p)))))
(ert-deftest python-info-beginning-of-statement-p-2 ()
@@ -4895,7 +4895,7 @@ if width == 0 and height == 0 and \\
(should (not (python-info-beginning-of-statement-p)))
(python-tests-look-at "raise ValueError(")
(should (python-info-beginning-of-statement-p))
- (goto-char (line-beginning-position))
+ (goto-char (pos-bol))
(should (not (python-info-beginning-of-statement-p)))))
(ert-deftest python-info-end-of-statement-p-1 ()
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index ef1e5c3eafc..23ec24840fb 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -378,7 +378,7 @@ Each element has the format:
(goto-char (point-min))
(should (string-match "\\`2 matches for \"and\" in buffer: "
(buffer-substring-no-properties
- (point) (line-end-position)))))))
+ (point) (pos-eol)))))))
(and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
@@ -401,7 +401,7 @@ Each element has the format:
(goto-char (point-min))
(should (string-match "\\`2 matches for \"and\" in buffer: "
(buffer-substring-no-properties
- (point) (line-end-position)))))))
+ (point) (pos-eol)))))))
(and (buffer-name temp-buffer)
(kill-buffer temp-buffer)))))
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index b4576889dcd..97f425f6f48 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -321,7 +321,7 @@ See bug#35036."
;; Stay at BOB.
(forward-line -1)
(save-restriction
- (narrow-to-region (point) (line-end-position))
+ (narrow-to-region (point) (pos-eol))
(should-not (delete-indentation))
(should (equal (simple-test--buffer-substrings)
'("" . " second ")))
@@ -344,27 +344,23 @@ See bug#35036."
(should (equal (simple-test--buffer-substrings)
'(" first " . "")))
;; Single line.
- (should-not (delete-indentation
- nil (line-beginning-position) (1- (point))))
+ (should-not (delete-indentation nil (pos-bol) (1- (point))))
(should (equal (simple-test--buffer-substrings)
'("" . " first ")))
- (should-not (delete-indentation nil (1+ (point)) (line-end-position)))
+ (should-not (delete-indentation nil (1+ (point)) (pos-eol)))
(should (equal (simple-test--buffer-substrings)
'(" " . "first ")))
- (should-not (delete-indentation
- nil (line-beginning-position) (line-end-position)))
+ (should-not (delete-indentation nil (pos-bol) (pos-eol)))
(should (equal (simple-test--buffer-substrings)
'("" . " first ")))
;; Multiple lines.
(goto-char (point-max))
(insert "\n second \n third \n fourth ")
(goto-char (point-min))
- (should-not (delete-indentation
- nil (line-end-position) (line-beginning-position 2)))
+ (should-not (delete-indentation nil (pos-eol) (pos-bol 2)))
(should (equal (simple-test--buffer-substrings)
'(" first" . " second \n third \n fourth ")))
- (should-not (delete-indentation
- nil (point) (1+ (line-beginning-position 2))))
+ (should-not (delete-indentation nil (point) (1+ (pos-bol 2))))
(should (equal (simple-test--buffer-substrings)
'(" first second" . " third \n fourth ")))
;; Prefix argument overrides region.
@@ -808,7 +804,7 @@ See Bug#21722."
(insert "a\nb\nc\nd\n")
(goto-char (point-min))
(forward-line (1- target-line))
- (narrow-to-region (line-beginning-position) (line-end-position))
+ (narrow-to-region (pos-bol) (pos-eol))
(should (equal (line-number-at-pos) 1))
(should (equal (line-number-at-pos nil t) target-line)))))
@@ -817,7 +813,7 @@ See Bug#21722."
(insert "a\nb\nc\nd\n")
(goto-char (point-min))
(forward-line 2)
- (narrow-to-region (line-beginning-position) (line-end-position))
+ (narrow-to-region (pos-bol) (pos-eol))
(should (equal (line-number-at-pos) 1))
(line-number-at-pos nil t)
(should (equal (line-number-at-pos) 1))))
diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el
index a746edf8944..1d2d556992b 100644
--- a/test/lisp/textmodes/css-mode-tests.el
+++ b/test/lisp/textmodes/css-mode-tests.el
@@ -435,7 +435,7 @@
'css-selector)
(should-not (format "Didn't recognize %s as a selector"
(buffer-substring-no-properties
- (point) (line-end-position)))))))
+ (point) (pos-eol)))))))
;; Test many selectors.
(dolist (selector selectors)
(with-temp-buffer
@@ -451,7 +451,7 @@
'css-selector)
(should-not (format "Didn't recognize %s as a selector"
(buffer-substring-no-properties
- (point) (line-end-position)))))))
+ (point) (pos-eol)))))))
;; Test wrong separators.
(dolist (selector selectors)
(with-temp-buffer
@@ -467,7 +467,7 @@
'css-selector)
(should-not (format "Recognized %s as a selector"
(buffer-substring-no-properties
- (point) (line-end-position))))))))))
+ (point) (pos-eol))))))))))
(ert-deftest scss-mode-test-selectors ()
(let ((selectors
@@ -485,7 +485,7 @@
'css-selector)
(should-not (format "Didn't recognize %s as a selector"
(buffer-substring-no-properties
- (point) (line-end-position))))))))))
+ (point) (pos-eol))))))))))
(provide 'css-mode-tests)
diff --git a/test/lisp/textmodes/fill-tests.el b/test/lisp/textmodes/fill-tests.el
index b730de5a690..f2a0daf8122 100644
--- a/test/lisp/textmodes/fill-tests.el
+++ b/test/lisp/textmodes/fill-tests.el
@@ -53,8 +53,8 @@
(goto-char (point-min))
(search-forward "b")
(let* ((pos (point))
- (beg (line-beginning-position))
- (end (line-end-position))
+ (beg (pos-bol))
+ (end (pos-eol))
(fill-prefix (make-string (- pos beg) ?\s))
;; `fill-column' is too small to accommodate the current line
(fill-column (- end beg 10)))
@@ -68,8 +68,8 @@
(goto-char (point-min))
(search-forward "b")
(let* ((pos (point))
- (beg (line-beginning-position))
- (end (line-end-position))
+ (beg (pos-bol))
+ (end (pos-eol))
(fill-prefix (make-string (- pos beg) ?\s))
;; `fill-column' is too small to accommodate the current line
(fill-column (- end beg 10)))
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index 8361d58b558..55e37b71d80 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -147,13 +147,11 @@
(string-to-number line-limit1))))
(goto-char (point-min))
(if (> limit-number 0)
- (should (= search-limit (line-beginning-position
- (1+ limit-number))))
+ (should (= search-limit (pos-bol (1+ limit-number))))
(should (= search-limit (point-max))))
(goto-char (point-max))
(if (< limit-number 0)
- (should (= start (line-beginning-position
- (1+ limit-number))))
+ (should (= start (pos-bol (1+ limit-number))))
(should (= start (point-min)))))
(if (equal start1 "")
(should (equal ts-start time-stamp-start))