1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00
Commit Graph

3216 Commits

Author SHA1 Message Date
Mattias Engdegård
cbd439e785 Expand rx definitions inside (not ...)
* lisp/emacs-lisp/rx.el (rx--translate-not):
* test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-def-in-not):
* doc/lispref/searching.texi (Rx Constructs, Extending Rx):

Allow user-defined rx constructs to be expanded inside (not ...)
forms, for better composability (bug#37849).
2019-10-27 09:54:54 +01:00
Michael Albinus
6e66d9a95c Some Tramp trace improvements
* lisp/net/tramp.el (tramp-call-process): `result' can also be nil.

* test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Improve trace format.
2019-10-27 09:36:56 +01:00
Juri Linkov
c6667cc6a9 dired-dwim-target uses most recently visited window instead of next window.
* doc/emacs/dired.texi (Operating on Files): Document behavior change.

* lisp/dired-aux.el (dired-dwim-target-directories): New function.
(dired-dwim-target-directory, dired-dwim-target-defaults): Use it
to get the most recently used window instead of the next window (bug#35385).

* lisp/dired.el (dired-dwim-target): Doc fix.

* test/lisp/dired-tests.el: Remove unnecessary require and pacify
byte-compiler.
2019-10-27 02:20:15 +03:00
Stephen Gildea
f247599e16 time-stamp-tests: add name prefix to tests of formatting
* time-stamp-tests.el: rename all the time-stamp-string formatting tests
to have the word "format" in their name, to make room in the namespace
for other, future tests.
2019-10-26 14:31:39 -07:00
Stephen Gildea
4e271a6c36 time-stamp-tests: consistently name the time vars
* time-stamp-tests.el (with-time-stamp-test-env): rename local variable
'ref-time' to 'ref-time1', for parallelism with ref-time2 and ref-time3.
2019-10-25 08:45:27 -07:00
Glenn Morris
5f67809a8f Set expected result for a cedet test
* test/lisp/cedet/srecode-utest-template.el (srecode-utest-project):
Test fails on hydra.nixos.org, for some reason.
2019-10-22 16:25:21 -07:00
Stefan Kangas
0e6f4628d8 Don't try to add nil packages on refresh
* lisp/emacs-lisp/package.el (package-read-archive-contents): Don't
try to add nil entries.  Warn instead.  (Bug#28502)
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives/ignore-nil-entry): New test.
* test/lisp/emacs-lisp/package-resources/with-nil-entry/archive-contents:
New file.
2019-10-21 00:00:36 +02:00
Michael Albinus
36c75c2a41 * test/lisp/net/tramp-tests.el (remote-file-name-inhibit-cache): Set to nil. 2019-10-18 19:45:07 +02:00
Mattias Engdegård
6331d23de3 Use [^z-a] for matching any character (anychar/anything) in rx
* lisp/emacs-lisp/rx.el (rx--translate-symbol):
* test/lisp/emacs-lisp/rx-tests.el (rx-any, rx-atoms):
Use [^z-a] instead of ".\\|\n" for anychar.

The new expression is faster (about 2×) and does not allocate regexp
stack space.  For example, (0+ anychar) now matches strings of any
size (bug#37659).
2019-10-18 14:46:12 +02:00
Mattias Engdegård
ae5407b857 Add `unmatchable' as alias for (or) in rx (bug#37659)
* lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx):
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms):
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Add `unmatchable', more descriptive than (or), and corresponding to
the variable `regexp-unmatchable'.
2019-10-18 14:46:06 +02:00
Mattias Engdegård
e5a446b0a7 Add anychar' as alias to anything' in rx (bug#37659)
* lisp/emacs-lisp/rx.el (rx--translate-symbol, rx--builtin-symbols, rx):
* test/lisp/emacs-lisp/rx-tests.el (rx-atoms):
* doc/lispref/searching.texi (Rx Constructs):
* etc/NEWS:
Add `anychar', an alias for `anything'.  Since `anychar' is more
descriptive (and slightly shorter), treat it as the preferred name.
2019-10-18 14:45:47 +02:00
Eric Ludlam
06114b79a5 Fix test data broken by removing trailing whitespace. 2019-10-15 11:08:18 -04:00
Eric Ludlam
26f5edf0c8 Adapt the CEDET SRecoder getset tests to use ERT
These tests were copied from CEDET from SourceForge.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
57a786db5a Adapt the CEDET SRecoder template test to use ERT
These tests were copied from CEDET from SourceForge.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
3f8915a019 Copy CEDET/Semantic's tag formatter test suite to be an
automated test.
These tests were copied from CEDET on Sourceforge and adapted to use ERT.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
128f803197 Update CEDET manual tests so that they run.
To run visit test/manual/cedet/cedet-utests.el
M-x eval-buffer
M-x cedet-utest
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Eric Ludlam
a99812ee0f Convert manual CEDET tests from test/manual/cedet to be
automated tests in test/lisp/cedet.
Author: Eric Ludlam <zappo@gnu.org>
2019-10-15 11:08:18 -04:00
Mattias Engdegård
67ed6ee733 Correctly explain test failures with mixed uni/multibyte strings
* lisp/emacs-lisp/ert.el (ert--explain-equal-rec):
* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-equal):
When explaining a difference between a unibyte and a multibyte string,
first convert both to multibyte.  Otherwise, we might end up comparing
unibyte char C to multibyte char C, 127<C<256, and not detect the
difference (bug#30219).
2019-10-13 20:29:27 +02:00
Stephen Gildea
d9a01dcd9f Minor tweaks to time-stamp documentation strings
* time-stamp.el (time-stamp): Reformat the explanation of the
variables that affect time-stamp, for easier reading.  In particular,
wrap the documentation to 75 characters, so that it displays neatly as
a before-save-hook customization option.

* time-stamp-tests.el (with-time-stamp-test-env): Use imperative voice,
per checkdoc.
2019-10-13 07:59:59 -07:00
Michael Albinus
15ed1598b5 Adapt some Tramp tests
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory): Adapt regexp of summary line.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Extend test for symlinked directories.
2019-10-12 12:20:55 +02:00
Andrea Corallo
421db07d06 * lisp/emacs-lisp/map.el (map-into) <hash-table>: Allow keyword args
(map--into-hash): New function, extracted from `map-into <hash-table>`.
Speed it up a bit by using gethash instead of map-elt when we know
we're accessing a hash table.

* test/lisp/emacs-lisp/map-tests.el (test-map-into): Add corresponding test.
2019-10-11 12:18:21 -04:00
Lars Ingebrigtsen
b5d2c6ee01 Remove two checkdoc tests checked in by mistake
* test/lisp/emacs-lisp/checkdoc-tests.el: Remove &aux and &context
checks mistakenly checked in (as these aren't implemented) (bug#37697).
2019-10-11 07:46:41 +02:00
Paul Eggert
288e00d69a Port time-stamp-test-time-zone to macOS
Problem reported by Stefan Kangas in:
https://lists.gnu.org/r/emacs-devel/2019-10/msg00360.html
* test/lisp/time-stamp-tests.el (time-stamp-test-time-zone):
Don’t assume (format-time-string "%Z" 0 t) returns "GMT".
2019-10-10 00:16:21 -07:00
Damien Cassou
46d11bcfa3 checkdoc CL tests
* test/lisp/emacs-lisp/checkdoc-tests.el: Add cl-lib-related tests
(bug#37063).
2019-10-10 02:19:10 +02:00
Lars Ingebrigtsen
9ab3f16c46 Fix formatting of (file-size-human-readable 2047)
* lisp/files.el (file-size-human-readable): Don't format
slightly-less numbers as X.0k, but just Xk instead (bug#36329).
2019-10-10 01:57:54 +02:00
Stephen Gildea
600bcde608 time-stamp: revert recent change to "%04y"
* time-stamp.el (time-stamp-string-preprocess): Revert change to "%04y"
format made 2 weeks ago by commit 0e56883878 (the previous commit to
this file).  Although undocumented, "%04y" was discovered to be in use
in the wild (2016) and had not issued a warning that it would change.
Add a warning that it will change.

* time-stamp-tests.el (time-stamp-test-year-2digit): add test of "%04y"
2019-10-09 09:19:10 -07:00
Stephen Gildea
697a7a1497 Expand testing of time-stamp format "%y"
* time-stamp-tests.el (time-stamp-test-year): break into two tests,
time-stamp-test-year-2digit and time-stamp-test-year-4digit.  Expand
time-stamp-test-year-2digit to look more like tests for other 2-digit
conversions.
2019-10-09 09:08:19 -07:00
Federico Tedin
f96b8fd27c Filter packages by name in list-packages. (Bug#36981)
* lisp/emacs-lisp/package.el (package-menu-filter-by-name): New
function to filter packages by name.
(package-menu-clear-filter): New function to clear applied filters.
(package-menu-filter-by-keyword): Rename function from
package-menu-filter.
(package-menu--generate): Don't change 'q' binding anymore.
(package-menu-mode-map): Bind '/ n' to package-menu-filter-by-name, '/
k' to package-menu-filter-by-keyword and '/ /' to
package-menu-clear-filter.
(package-menu-mode-menu): Update menu entries for the three functions.
* test/lisp/emacs-lisp/package-tests.el (package-test-list-filter-by-name)
(package-test-list-clear-filter): New tests.
* doc/emacs/package.texi: Document usage of
package-menu-filter-by-name, package-menu-clear-filter and update
reference to package-menu-filter-by-keyword.
* etc/NEWS: Announce changes.
2019-10-08 19:24:12 +02:00
Stefan Monnier
b12edc6171 * lisp/emacs-lisp/package.el (package--get-deps): Fix thinko
* test/lisp/emacs-lisp/package-tests.el (package-test-get-deps):
Adjust test to new calling convention.
2019-10-08 09:36:01 -04:00
Stefan Kangas
9839466b23 Add "python3 -m twine" example to comint-password-prompt tests
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add
new example for "python3 -m twine" to test suite.  (Bug#37636)
2019-10-07 20:51:53 +02:00
Paul Eggert
9d829b8be5 Fix off-by-one bug in ISO 8601 BC years
* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601-parse-date):
Don’t bother to separate the year’s sign from the year,
as that distinction is not needed: ISO 8601 uses
astronomical year numbering with a year zero, which
is what the Emacs time functions use, so there’s no
need to treat nonpositive years specially.
(iso8601--adjust-year): Remove; no longer needed
since callers can just use string-to-number.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years):
Adjust test case to match fixed behavior.
2019-10-05 21:24:09 -07:00
Paul Smith
e72e4990f9 Support GNU make error messages in compile mode.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Match GNU make error messages.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Test GNU make error message matching.
(compile-test-error-regexps): Update count of infos found.
2019-10-05 12:33:23 -07:00
Lars Ingebrigtsen
4f2de56830 Remove some XEmacs compat code from the CEDET tests 2019-10-05 17:01:33 +02:00
Stefan Kangas
ef8fadf8c1 Add tests for secure-hash and improve doc string (Bug#37420)
* src/fns.c (Fsecure_hash_algorithms): Fix typo.
(Fsecure_hash): Add algorithm list to doc string.
* test/src/fns-tests.el (test-secure-hash): New test.
2019-10-04 17:30:57 +02:00
Mattias Engdegård
32558cfe53 Fix error in gnu compilation-mode regexp (bug#37582)
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Fix a mistake introduced when the regexp was translated to rx.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-test-error-regexps): Add test case.
* etc/compilation.txt: Add example.
2019-10-04 15:43:15 +02:00
Mattias Engdegård
d09cbcee9c Make compile-tests re-runnable
* test/lisp/progmodes/compile-tests.el (compile-test-error-regexps):
Don't rely on compilation-num-errors (etc) all being zero, which they
aren't if the test has been run before.
(compile-tests--test-regexps-data): Change defvar to defconst.
2019-10-04 15:43:15 +02:00
Stefan Kangas
93dd959711 More doc fixes in package.el (Bug#37544)
* lisp/emacs-lisp/package.el (package-menu-hide-low-priority)
(package-pinned-packages, package-load-descriptor)
package-archive-version, package-archive-contents)
package--read-archive-file, package-read-archive-contents)
(package-unsigned-archives, package-read-all-archive-contents)
(package--download-and-read-archives, package-install):
* lisp/subr.el (package--description-file):
* test/lisp/emacs-lisp/package-tests.el: Doc fixes.
2019-10-04 01:14:15 +02:00
Basil L. Contovounesios
0fc8177414 Further improve button.el support for help-echo
The last change to forward-button added support for help-echo values
that are functions.  This patch fixes the arguments passed to such
functions and further adds support for help-echo values that are
forms (bug#37515).
* doc/lispref/display.texi (Button Properties): Fix description of
help-echo button property.
* lisp/button.el (button--help-echo): New function.
(forward-button): Use it.
(backward-button): Clarify help-echo reference in docstring.
* test/lisp/button-tests.el (button--help-echo-string)
(button--help-echo-form, button--help-echo-function): New tests.
2019-10-03 23:05:14 +01:00
Michael Albinus
5b09393f2c Fix typo in last commit 2019-10-03 10:47:12 +02:00
Michael Albinus
b27c7f3e60 Further adaptions for shadowfile-tests.el
* test/lisp/shadowfile-tests.el: Change some traces.
(shadow-test-remote-temporary-file-directory): Adapt also remote
home directory.
(shadow--tests-cleanup): Cleanup Tramp.
2019-10-03 10:44:02 +02:00
Glenn Morris
b0043f688a Update a substitute-command-keys test
* test/src/doc-tests.el (doc-test-substitute-command-keys):
Update for recent minibuffer map change.
2019-10-01 17:35:26 -07:00
Stephen Gildea
0e56883878 Move undocumented time-stamp formats closer to format-time-string
* time-stamp.el (time-stamp-string-preprocess): Update some undocumented
formatting characters of time-stamp format for closer (still incomplete)
alignment with format-time-string.  They have displayed a warning since
Emacs 20 (released in 1997), so it is unlikely anyone is using them.

* time-stamp-tests.el: Update tests to match new expectations.
2019-09-30 20:22:51 -07:00
Stephen Gildea
8ba1ca54f3 time-stamp doc: recommend formats closer to format-time-string
* time-stamp.el (time-stamp-format, time-stamp-pattern): Update
recommended (documented) formats.  No code changes, just documentation.
All recommended formats are compatible at least as far back as Emacs
22.1 (released in 2007) and are now closer to compatibility with
format-time-string.

* time-stamp-tests.el: Update test comments to match.
2019-09-30 20:08:12 -07:00
Lars Ingebrigtsen
c34801f883 Update iso8601-tests for new interface 2019-09-29 21:57:59 +02:00
Lars Ingebrigtsen
0df01e3aa5 Add support for sub-second ISO8601 strings
* lisp/calendar/iso8601.el (iso8601--decimalize): New function.
(iso8601-parse-time): Support sub-second ISO8601 times.
2019-09-29 21:22:36 +02:00
Mattias Engdegård
2fa33eb6ee Add `rx-submatch-n' for compatibility (bug#37517)
It was an internal symbol in the old `rx' implementation, used in old
versions of the `flycheck' package.

* lisp/emacs-lisp/rx.el (rx-submatch-n): Alias of `rx-to-string'.
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Test it.
2019-09-29 17:08:43 +02:00
Mattias Engdegård
19405291aa Fix linear equation system solving in Calc (bug#35374)
* lisp/calc/calcalg2.el (math-try-solve-for):
To solve Ax^n=0 where A is a nonzero constant and x the variable to
solve for, solve x^n=0 instead of solving A=0 (which obviously fails)
or something equally stupid.
* test/lisp/calc/calc-tests.el (calc-test-solve-linear-system): New.
2019-09-29 13:41:21 +02:00
Lars Ingebrigtsen
9767bd2b78 Add some commented-out tests for iso8601 2019-09-29 13:04:01 +02:00
Stephen Gildea
c359782ae6 Reorganize time-stamp tests
* time-stamp-tests.el: Group tests by when the format was or will be
documented.  Add tests for a few more undocumented, volatile formats.
Change AM hours test time to be a different hour from PM test time.
(Making these changes to the tests now will minimize test changes
needed later with anticipated code changes.)
2019-09-28 15:48:45 -07:00
Mauro Aranda
283fd5f2f6 Don't discard customizations in progress when adding comments (Bug#5358)
* lisp/cus-edit.el (custom-comment-show): Add docstring.  Save the
widget value in the :shown-value property, before redrawing.
(custom-variable-modified-p): New function, to complement the return
values of custom-variable-state.
(custom-variable-state-set): Use it.
(custom-face-value-create): Add children to the custom-face widget
before setting the state, to be able to check for user edits.
(custom-face-state-set): Check for user edits before calling
custom-face-state (bug#5358).

* test/lisp/custom-tests.el
(custom-test-show-comment-preserves-changes): New test.
2019-09-27 18:06:36 +02:00