[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 e660801 2/3: ; Add thing-at-point-looking-at test
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-26 e660801 2/3: ; Add thing-at-point-looking-at test (Bug#35708) |
Date: |
Fri, 5 Jul 2019 21:52:28 -0400 (EDT) |
branch: emacs-26
commit e6608010d7187e7801a4b9e6119ffd641fd06986
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
; Add thing-at-point-looking-at test (Bug#35708)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.
---
test/lisp/thingatpt-tests.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index 452fcc6..f787aa6 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