diff options
author | Noam Postavsky <npostavs@gmail.com> | 2019-05-13 08:39:00 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2019-07-05 21:50:37 -0400 |
commit | e6608010d7187e7801a4b9e6119ffd641fd06986 (patch) | |
tree | f0d7382714a56645a3435e3669288c24b59b982e /test/lisp/thingatpt-tests.el | |
parent | f5b48469f18d568f788efe65a4754e73c3404bc9 (diff) | |
download | emacs-e6608010d7187e7801a4b9e6119ffd641fd06986.tar.gz emacs-e6608010d7187e7801a4b9e6119ffd641fd06986.tar.bz2 emacs-e6608010d7187e7801a4b9e6119ffd641fd06986.zip |
; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
Diffstat (limited to 'test/lisp/thingatpt-tests.el')
-rw-r--r-- | test/lisp/thingatpt-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 452fcc6895b..f787aa69aad 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -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 |