From 4d8fd9cf338cf9b5dfc613657adfeabff2d9c14e Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 4 May 2016 01:59:29 +0300 Subject: Handle "empty line" regexp in xref searches * lisp/progmodes/xref.el (xref--collect-matches-1): Stop after one match if re-search-forward doesn't move point (bug#23426). * test/automated/xref-tests.el (xref-collect-matches-finds-an-empty-line-regexp-match): Uncomment test. --- test/automated/xref-tests.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/automated/xref-tests.el b/test/automated/xref-tests.el index 1b500c3c418..28ca3511c22 100644 --- a/test/automated/xref-tests.el +++ b/test/automated/xref-tests.el @@ -28,10 +28,10 @@ (should (equal 0 (xref-file-location-column (nth 0 locs)))) (should (equal 4 (xref-file-location-column (nth 1 locs)))))) -;; (ert-deftest xref-collect-matches-finds-an-empty-line-regexp-match () -;; (let* ((matches (xref-collect-matches "^$" "*" xref-tests-data-dir nil)) -;; (locs (mapcar #'xref-item-location matches))) -;; (should (= 1 (length matches))) -;; (should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 0 locs)))) -;; (should (equal 1 (xref-location-line (nth 0 locs)))) -;; (should (equal 0 (xref-file-location-column (nth 0 locs)))))) +(ert-deftest xref-collect-matches-finds-an-empty-line-regexp-match () + (let* ((matches (xref-collect-matches "^$" "*" xref-tests-data-dir nil)) + (locs (mapcar #'xref-item-location matches))) + (should (= 1 (length matches))) + (should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 0 locs)))) + (should (equal 1 (xref-location-line (nth 0 locs)))) + (should (equal 0 (xref-file-location-column (nth 0 locs)))))) -- cgit v1.2.1