diff options
| author | Noam Postavsky | 2019-05-13 08:39:00 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-07-05 21:50:37 -0400 |
| commit | e6608010d7187e7801a4b9e6119ffd641fd06986 (patch) | |
| tree | f0d7382714a56645a3435e3669288c24b59b982e | |
| parent | f5b48469f18d568f788efe65a4754e73c3404bc9 (diff) | |
| download | emacs-e6608010d7187e7801a4b9e6119ffd641fd06986.tar.gz emacs-e6608010d7187e7801a4b9e6119ffd641fd06986.zip | |
; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
| -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 @@ | |||
| 20 | ;;; Code: | 20 | ;;; Code: |
| 21 | 21 | ||
| 22 | (require 'ert) | 22 | (require 'ert) |
| 23 | (require 'thingatpt) | ||
| 23 | 24 | ||
| 24 | (defvar thing-at-point-test-data | 25 | (defvar thing-at-point-test-data |
| 25 | '(("https://1.gnu.org" 1 url "https://1.gnu.org") | 26 | '(("https://1.gnu.org" 1 url "https://1.gnu.org") |
| @@ -131,4 +132,15 @@ position to retrieve THING.") | |||
| 131 | (goto-char 23) | 132 | (goto-char 23) |
| 132 | (should (equal (thing-at-point 'url) "http://foo/bar(baz)")))) | 133 | (should (equal (thing-at-point 'url) "http://foo/bar(baz)")))) |
| 133 | 134 | ||
| 135 | (ert-deftest thing-at-point-looking-at () | ||
| 136 | (with-temp-buffer | ||
| 137 | (insert "1abcd 2abcd 3abcd") | ||
| 138 | (goto-char (point-min)) | ||
| 139 | (let ((m2 (progn (search-forward "2abcd") | ||
| 140 | (match-data)))) | ||
| 141 | (goto-char (point-min)) | ||
| 142 | (search-forward "2ab") | ||
| 143 | (should (thing-at-point-looking-at "2abcd")) | ||
| 144 | (should (equal (match-data) m2))))) | ||
| 145 | |||
| 134 | ;;; thingatpt.el ends here | 146 | ;;; thingatpt.el ends here |