]> git.eshelyaron.com Git - emacs.git/commitdiff
; Add thing-at-point-looking-at test (Bug#35708)
authorNoam Postavsky <npostavs@gmail.com>
Mon, 13 May 2019 12:39:00 +0000 (08:39 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 6 Jul 2019 01:50:37 +0000 (21:50 -0400)
* test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test.

test/lisp/thingatpt-tests.el

index 452fcc6895b9a3670d67be27af6e08e6bcea479f..f787aa69aadf1baf136c7d4083f6aa5e01447a66 100644 (file)
@@ -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