mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-23 07:19:15 +00:00
; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
This commit is contained in:
parent
f5b48469f1
commit
e6608010d7
@ -20,6 +20,7 @@
|
||||
;;; Code:
|
||||
|
||||
(require 'ert)
|
||||
(require 'thingatpt)
|
||||
|
||||
(defvar thing-at-point-test-data
|
||||
'(("https://1.gnu.org" 1 url "https://1.gnu.org")
|
||||
@ -131,4 +132,15 @@ position to retrieve THING.")
|
||||
(goto-char 23)
|
||||
(should (equal (thing-at-point 'url) "http://foo/bar(baz)"))))
|
||||
|
||||
(ert-deftest thing-at-point-looking-at ()
|
||||
(with-temp-buffer
|
||||
(insert "1abcd 2abcd 3abcd")
|
||||
(goto-char (point-min))
|
||||
(let ((m2 (progn (search-forward "2abcd")
|
||||
(match-data))))
|
||||
(goto-char (point-min))
|
||||
(search-forward "2ab")
|
||||
(should (thing-at-point-looking-at "2abcd"))
|
||||
(should (equal (match-data) m2)))))
|
||||
|
||||
;;; thingatpt.el ends here
|
||||
|
Loading…
Reference in New Issue
Block a user