mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 16:20:17 -08: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
1 changed files with 12 additions and 0 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'ert)
|
(require 'ert)
|
||||||
|
(require 'thingatpt)
|
||||||
|
|
||||||
(defvar thing-at-point-test-data
|
(defvar thing-at-point-test-data
|
||||||
'(("https://1.gnu.org" 1 url "https://1.gnu.org")
|
'(("https://1.gnu.org" 1 url "https://1.gnu.org")
|
||||||
|
|
@ -131,4 +132,15 @@ position to retrieve THING.")
|
||||||
(goto-char 23)
|
(goto-char 23)
|
||||||
(should (equal (thing-at-point 'url) "http://foo/bar(baz)"))))
|
(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
|
;;; thingatpt.el ends here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue