summaryrefslogtreecommitdiff
path: root/test/automated/xref-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* Port xref-tests to master branchPaul Eggert2016-05-061-91/+0
| | | | | | | | | | | | | Also, add a test to make this problem less likely in the future. * test/Makefile.in (check-no-automated-subdir): New rule. (check, check-expensive, check-maybe): Depend on it. * test/automated/data/xref/file1.txt: Rename to ... * test/data/xref/file1.txt: ... here. * test/automated/data/xref/file2.txt: Rename to ... * test/data/xref/file2.txt: ... here. * test/automated/xref-tests.el: Rename to ... * test/lisp/progmodes/xref-tests.el: ... here. (xref-tests-data-dir): Use EMACS_TEST_DIRECTORY.
* Rework xref-query-replace-in-resultsDmitry Gutov2016-05-051-0/+29
| | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref-query-replace-in-results): Collect all xrefs from the buffer first, then delegate most of the processing to the value returned by xref--buf-pairs-iterator. (xref--buf-pairs-iterator): New function. Return an "iterator" which partitions returned markers into buffers, and only processes markers from one buffer at a time. When an xref is out of date, skip it with a message instead of signaling error (bug#23284). (xref--outdated-p): Extract from xref--buf-pairs-iterator. Trim CR from both strings before comparing. (xref--query-replace-1): Remove the variable current-buf, no need to track it anymore. Simplify the filter-predicate and search functions accordingly. Iterate over buffer-markers pairs returned by the iterator, and call `perform-replace' for each of them. Use multi-query-replace-map (bug#23284). Use `switch-to-buffer' every time after the first, in order not to jump between windows. * test/automated/xref-tests.el (xref--buf-pairs-iterator-groups-markers-by-buffers-1) (xref--buf-pairs-iterator-groups-markers-by-buffers-2) (xref--buf-pairs-iterator-cleans-up-markers): New tests.
* ; * test/automated/xref-tests.el: Add copyright and license.Glenn Morris2016-05-031-0/+25
|
* Handle "empty line" regexp in xref searchesDmitry Gutov2016-05-041-7/+7
| | | | | | | | | * 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.
* Add tests for xref-collect-matchesDmitry Gutov2016-05-041-0/+37
* test/automated/xref-tests.el: New file. Add tests for xref-collect-matches.