(syntax-propertize line-end)
;; FIXME: This results in several lines with the same
;; summary. Solve with composite pattern?
- (while (re-search-forward regexp line-end t)
+ (while (and
+ ;; REGEXP might match an empty string. Or line.
+ (or (null matches)
+ (> (point) line-beg))
+ (re-search-forward regexp line-end t))
(let* ((beg-column (- (match-beginning 0) line-beg))
(end-column (- (match-end 0) line-beg))
(loc (xref-make-file-location file line beg-column))
(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))))))