1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
Commit Graph

4176 Commits

Author SHA1 Message Date
Mattias Engdegård
cde72637df Fix sunrise and sunset calculation (bug#44237)
* lisp/calendar/solar.el (solar-moment): Use initial values for binary
search that won't end the loop prematurely and yield incorrect
answers.
* test/lisp/calendar/solar-tests.el: New file.
2020-10-27 12:33:51 +01:00
Mattias Engdegård
f971a612a9 Don't rely on bignums in ntlm.el
Since ntlm.el is distributed as a separate package in GNU ELPA and
should be able to run on older Emacs versions without bignums,
we cannot make use of them here.  See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg01665.html.
Instead, we add a small poor man's bignum implementation.

* lisp/net/ntlm.el (ntlm--bignat-of-int, ntlm--bignat-add)
(ntlm--bignat-shift-left, ntlm--bignat-mul-byte, ntlm--bignat-mul)
(ntlm--bignat-of-string, ntlm--bignat-of-digits)
(ntlm--bignat-to-int64): New.
(ntlm--time-to-timestamp): Use the ntlm--bignat- functions instead
of Lisp integers.
* test/lisp/net/ntlm-tests.el: New file.
2020-10-27 12:25:57 +01:00
Lars Ingebrigtsen
eb57ae0844 Fix time-test error on machines with mail
* test/lisp/time-tests.el (time-tests-display-time-update): There
may be mail on the machine (bug#44241).
2020-10-26 21:23:55 +01:00
Lars Ingebrigtsen
b8b18cf34a Implement a :predicate parameter for globalized minor modes
* doc/lispref/modes.texi (Defining Minor Modes): Describe the new
:predicate keyword (bug#44232).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Allow a new :predicate keyword.
(easy-mmode--globalized-predicate-p): New function.
2020-10-26 19:15:36 +01:00
Andrea Corallo
fd9e9308d2 Make native compiler tollerant to redefined primitives (bug#44221).
* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Rework based
	on the fact that the subr can now be redefined.
	* test/src/comp-tests.el (primitive-redefine-compile-44221):
	New testcase.
2020-10-26 16:34:20 +00:00
Andrea Corallo
5edc7aa019 Fix defsubst effectiveness (bug#44209)
* lisp/emacs-lisp/byte-run.el (defsubst): Fix macro definition.
	* test/src/comp-tests.el (comp-test-defsubst): New testcase.
	* test/src/comp-test-funcs.el (comp-test-defsubst-f): New
	function.
2020-10-25 22:56:50 +00:00
Philipp Stephani
e73e7a8bd6 Revert commit 1f44a77672 for XRef.
XRef supports Emacs versions back to Emacs 26.3, so it can’t use newer
functions such as ‘ert-resource-directory’.

* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don’t use
‘ert-resource-directory’
2020-10-25 11:24:11 +01:00
Philipp Stephani
2e090da775 Revert commit 1f44a77672 for Flymake.
Flymake supports all Emacs versions back to 26.1, so it can’t use
‘ert-resource-file’.

* test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory):
Recreate.
(flymake-tests--call-with-fixture): Stop using ‘ert-resource-file’.
2020-10-25 10:59:11 +01:00
Stefan Kangas
dd16e46bb9 ; Prefer https to http in more URLs
These were all tested and confirmed working.
2020-10-24 20:23:27 +02:00
Michael Albinus
95553309ef Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil
COMMAND.  (Bug#44151)

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process):
Extend test.
2020-10-24 14:36:34 +02:00
Stefan Kangas
9f1dd2a7d5 Use lexical-binding in copyright.el and add tests
* lisp/emacs-lisp/copyright.el: Use lexical-binding.  Remove
redundant :group args.
* test/lisp/emacs-lisp/copyright-tests.el: New file.
2020-10-24 13:35:49 +02:00
Stefan Kangas
ff1068936f * test/manual/image-transforms-tests.el: Use lexical-binding. 2020-10-24 13:35:49 +02:00
Stefan Kangas
228d9d615d Move faces.el test data to follow our conventions
* test/lisp/faces-tests.el (ert-x): Require.
(faces--test-data-dir): Remove variable.
(faces--test-extend-with-themes): Use ert-resource-directory.
* test/lisp/faces-resources/*: Moved from test/data/themes/*.
2020-10-24 13:35:49 +02:00
Michael Albinus
8b1ccf5e7b Fix tramp-sh-handle-make-process; don't merge with master
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil
COMMAND.  (Bug#44151)

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process):
Extend test.
2020-10-24 13:08:31 +02:00
Stefan Kangas
3af9e84ff5 Fix a broken unsafep test
* test/lisp/emacs-lisp/unsafep-tests.el
(test-unsafep/message): Fix test case.

(unsafep-tests--safe): Rename from testcover-unsafep-safe.
(unsafep-tests--unsafe): Rename from testcover-unsafep-unsafe.
(test-unsafep/safe, test-unsafep/unsafe): Doc fix.  Adjust usage
of above renamed variables.
2020-10-24 03:20:48 +02:00
Stefan Kangas
8461cfc8fc Move epg.el test data to follow our conventions
* test/lisp/epg-tests.el (ert-x): Require.
(epg-tests-data-directory): Remove variable.
(with-epg-tests): Use ert-resource-file.
* test/lisp/epg-resources/*: Moved from test/data/epg/.
2020-10-24 02:36:55 +02:00
Stefan Kangas
e402887d5d Move shr.el test data to follow our conventions
* test/lisp/net/shr-tests.el (ert, ert-x): Require.
(shr-tests--datadir): Remove variable.
(shr-test, rendering): Use ert-resource-directory.
* test/lisp/net/shr-resources/*: Move from test/data/shr/.
2020-10-24 02:29:04 +02:00
Stefan Kangas
ab7dddea90 Move mml-sec.el test data to follow our conventions
* test/lisp/gnus/mml-sec-tests.el (ert-x): Require.
(mml-secure-test-fixture, mml-sec-test--kill-gpg-agent):
Use ert-resource-directory.
* test/lisp/gnus/mml-sec-resources/*: Moved from test/data/mml-sec/.
* .gitignore: Update location of moved file "random_seed".
2020-10-24 02:21:07 +02:00
Andrea Corallo
99e7cc0da6 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-23 20:08:58 +01:00
Stefan Kangas
72c9d4bee1 Move more test data to follow our conventions
* test/data/minibuffer-test-cttq$tion: Move from here...
* test/lisp/minibuffer-resources/data/minibuffer-test-cttq$tion:
...to here.
* test/lisp/minibuffer-resources/lisp/cedet/semantic-utest-c.test:
* test/lisp/minibuffer-resources/lisp/cedet/semantic-utest.test:
New files.
* test/lisp/minibuffer-tests.el (ert, ert-x): Require.
(completion-table-test-quoting): Use ert-resource-directory.

* test/data/net/cert.pem:
* test/data/net/key.pem: Move frome here...
* test/lisp/net/network-stream-resources/cert.pem:
* test/lisp/net/network-stream-resources/key.pem: ...to here.
* test/lisp/net/network-stream-tests.el (ert, ert-x): Require.
(network-stream-tests--datadir): Remove variable.
(make-tls-server): Use ert-resource-file.

* test/data/vc/diff-mode/hello_emacs.c:
* test/data/vc/diff-mode/hello_emacs_1.c:
* test/data/vc/diff-mode/hello_world.c:
* test/data/vc/diff-mode/hello_world_1.c: Move from here...
* test/lisp/vc/diff-mode-resources/hello_emacs.c:
* test/lisp/vc/diff-mode-resources/hello_emacs_1.c:
* test/lisp/vc/diff-mode-resources/hello_world.c:
* test/lisp/vc/diff-mode-resources/hello_world_1.c: ...to here.
* test/lisp/vc/diff-mode-tests.el (ert, ert-x): Require.
(diff-mode-tests--datadir): Remove variable.
(diff-mode-test-font-lock-syntax-one-line)
(diff-mode-test-font-lock): Use ert-resource-directory.

* test/data/xdg/l10n.desktop:
* test/data/xdg/malformed.desktop:
* test/data/xdg/mimeapps.list:
* test/data/xdg/mimeinfo.cache:
* test/data/xdg/test.desktop: Move from here...
* test/lisp/xdg-resources/l10n.desktop:
* test/lisp/xdg-resources/malformed.desktop:
* test/lisp/xdg-resources/mimeapps.list:
* test/lisp/xdg-resources/mimeinfo.cache:
* test/lisp/xdg-resources/test.desktop: ...to here.
* test/lisp/xdg-tests.el (ert-x): Require.
(xdg-tests-data-dir): Remove variable.
(xdg-desktop-parsing, xdg-mime-associations): Use ert-resource-file.
2020-10-23 21:07:26 +02:00
Stefan Kangas
49bc8586b7 Move some test data to follow our conventions
* test/data/emacs-module/mod-test.c: Move from here...
* test/src/emacs-module-resources/mod-test.c: ...to here.
* test/src/emacs-module-tests.el (ert-x): Require.
(mod-test-file, module/describe-function-1):
* test/Makefile.in (test_module_dir): Adjust for move.

* test/data/files-bug18141.el.gz: Move from here...
* test/lisp/files-resources/files-bug18141.el.gz: ... to here.
* test/lisp/files-tests.el (ert-x): Require.
(files-test-bug-18141-file): Use ert-resource-file.

* test/data/mailcap/mime.types: Move from here...
* test/lisp/net/mailcap-resources/mime.types: ...to here.
* test/lisp/net/mailcap-tests.el (ert-x): Require.
(mailcap-tests-path): Use ert-resource-file.

* test/data/somelib.el:
* test/data/somelib2.el: Move from here...
* test/src/lread-resources/somelib.el:
* test/src/lread-resources/somelib2.el: ...to here.
* test/src/lread-tests.el (ert, ert-x): Require.
(lread-test-bug26837): Use ert-resource-directory.

* test/data/syntax-comments.txt: Move from here....
* test/src/syntax-resources/syntax-comments.txt: ...to here.
* test/src/syntax-tests.el (ert-x): Require.
(syntax-comments, syntax-br-comments, syntax-pps-comments):
Use ert-resource-file.

* test/data/xref/file1.txt:
* test/data/xref/file2.txt: Move from here...
* test/lisp/progmodes/xref-resources/file1.txt:
* test/lisp/progmodes/xref-resources/file2.txt: ...to here.
* test/lisp/progmodes/xref-tests.el (ert, ert-x): Require.
(xref-tests-data-dir): Use ert-resource-directory.
2020-10-23 16:29:46 +02:00
Ulf Jasper
9e4f11a163 Move icalendar test data to test/lisp/calendar/icalendar-resources
* test/lisp/calendar/icalendar-tests.el (ert-x): Required for
'ert-resource-file'.
(icalendar-tests--data-dir): Removed.
(icalendar-tests--get-file-contents): Use 'ert-resource-file' for
finding test data files.
* test/data/icalendar/*: Moved to test/lisp/calendar/icalendar-resources/.
* test/lisp/calendar/icalendar-resources/*: Moved from test/data/icalendar.
2020-10-23 14:48:49 +02:00
Stefan Kangas
22e5239c17 Clean up temporary files after package tests
* test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove
temporary files after test.  (Bug#43359)
2020-10-23 12:58:01 +02:00
Stefan Kangas
558065531b Merge branch 'scratch/substitute-command-keys' 2020-10-23 00:33:23 +02:00
Stefan Kangas
8c7a55531b Remove incorrect use of decode-coding-string
* test/lisp/emacs-lisp/bindat-tests.el
(bindat-test-pack/multibyte-string-fails)
(bindat-test-unpack/multibyte-string-fails): Don't use
decode-coding-string.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
2020-10-22 20:34:15 +02:00
Stefan Kangas
f6d1389796 Add missed file needed by time-tests.el
* test/lisp/time-resources/non-empty: New file.  This file is needed
by time-tests.el but was missed when it was committed.
2020-10-22 18:51:00 +02:00
Stefan Kangas
754a2f11b8 Add tests for perl-mode.el
* test/lisp/progmodes/perl-mode-tests.el: New file.
2020-10-22 18:23:49 +02:00
Ulf Jasper
e9d0f36248 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into master 2020-10-22 17:47:29 +02:00
Ulf Jasper
6342264ef7 Move test data for icalendar tests to separate files.
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--data-dir, icalendar-tests--get-file-contents):
New.
(icalendar-tests--test-import, icalendar-tests--do-test-import):
Read input and expected results from files.
(icalendar-import-non-recurring, icalendar-import-rrule)
(icalendar-import-duration, icalendar-import-bug-6766)
(icalendar-import-bug-24199, icalendar-import-bug-33277)
(icalendar-import-multiple-vcalendars, icalendar-import-with-uid)
(icalendar-import-with-timezone, icalendar-real-world): Move test
data (input and expected result) to separate files.

* test/calendar/icalendar/*
New files containing test data for icalendar tests.
2020-10-22 17:45:59 +02:00
Stefan Kangas
997ebf91dd Use lexical-binding in time-date.el and expand tests
* lisp/calendar/time-date.el: Use lexical-binding.
* test/lisp/calendar/time-date-tests.el
(test-obsolete-with-decoded-time-value)
(test-obsolete-encode-time-value, test-format-seconds)
(test-days-to-time, test-seconds-to-string): New tests.
(test-days-in-month, test-time-since, test-time-decoded-period):
Expand test with a few more values.
2020-10-22 17:33:29 +02:00
Stefan Kangas
0d7d09b0ef Test for error with multibyte strings in bindat.el
* test/lisp/emacs-lisp/bindat-tests.el
(bindat-test-pack/multibyte-string-fails)
(bindat-test-unpack/multibyte-string-fails): New tests.
2020-10-22 14:55:57 +02:00
Mauro Aranda
c009a0a6f7 Allow moving members of editable-list widget, via delete+insert
* etc/NEWS (Widget): Announce the feature (bug#6419).
* lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new
widget property, :last-deleted, the WIDGET to be deleted.  Add
docstring.
(widget-editable-list-insert-before): If there is a recently deleted
child for the editable list, insert that one, instead of a new default
widget.  Add docstring.
(insert-button widget): Make :help-echo a function to avoid the
help-echo string become too long.
(delete-button widget): Tweak the :help-echo string, to document this
behavior.

* test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item):
Test the feature.
2020-10-22 13:52:42 +02:00
Stefan Kangas
ffbea0d705 Tweak two time.el tests
* test/lisp/time-tests.el (time-tests-display-time-update--load)
(time-tests-display-time-update): Tweak tests.
2020-10-21 17:22:17 +02:00
Stefan Kangas
b69f363698 Add tests for time.el
* lisp/time.el (display-time-update--load)
(display-time-update--mail): Extract from...
(display-time-update): ...here.
* test/lisp/time-tests.el: New file.
2020-10-21 16:59:50 +02:00
Stefan Kangas
e656600c96 * test/lisp/vc/vc-bzr-tests.el: Use lexical-binding. 2020-10-21 13:26:57 +02:00
Stefan Kangas
95a458724d Use lexical-binding in files-x-tests.el
* test/lisp/files-x-tests.el: Use lexical-binding.
(remote-null-device): Declare.
2020-10-21 13:25:39 +02:00
Stefan Kangas
0aa881f231 Use lexical-binding in hfy-cmap.el and add tests
* lisp/hfy-cmap.el: Use lexical-binding.
(hfy-cmap--parse-buffer): Extract from...
(htmlfontify-load-rgb-file): ...here.

* test/lisp/hfy-cmap-resources/rgb.txt:
* test/lisp/hfy-cmap-tests.el: New files.
2020-10-21 13:06:38 +02:00
Andrea Corallo
3be93390fb Sanitize eln filename when native compiling single functions
* lisp/emacs-lisp/comp.el (comp-spill-lap-function): Fix
	temporary eln name generation.

	* test/src/comp-tests.el (free-fun-silly-name): New testcase.
2020-10-20 21:29:05 +01:00
Stefan Kangas
4a575eb18c byte-compile-file: Make optional LOAD argument obsolete
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Declare optional
LOAD argument obsolete.  Adjust callers.  (Bug#38072)
(byte-recompile-file): Declare optional LOAD argument obsolete.
* doc/lispref/compile.texi (Compilation Functions): Update
documentation to reflect above obsoletion.
* etc/NEWS: Announce above obsoletion.
2020-10-20 18:48:27 +02:00
Stefan Kangas
6a946d29a1 Tweak test data for signed package installation
* test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el:
* test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el:
Use lexical-binding.
* test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh:
New file.
* test/lisp/emacs-lisp/package-resources/key.pub:
* test/lisp/emacs-lisp/package-resources/key.sec: Add new key.
* test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig:
* test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig:
Update signatures using new key.
2020-10-20 18:26:38 +02:00
Stefan Kangas
196d6c851c Make a bookmark test more robust
* test/lisp/bookmark-tests.el (bookmark-tests-insert-annotation):
Make test more robust by not being timing dependent.
2020-10-20 03:21:31 +02:00
Stefan Kangas
fe16248b77 Make auto-revert-mode tests run faster
* test/lisp/autorevert-tests.el (auto-revert--timeout): Make into
defun and shorten timeout by a factor 10.
(auto-revert--wait-for-revert): Cut timeouts in half.
(with-auto-revert-test): New macro to set timeout to 0.1.
(auto-revert-tests--write-file): New defun.
(auto-revert-test00-auto-revert-mode)
(auto-revert-test01-auto-revert-several-files)
(auto-revert-test02-auto-revert-deleted-file)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired)
(auto-revert-test05-global-notify)
(auto-revert-test06-write-file): Adapt test to run faster.  Remove
:expensive-test marks.

This was discussed in:
https://lists.gnu.org/r/emacs-devel/2020-10/msg01233.html
2020-10-19 17:25:34 +02:00
Mattias Engdegård
653eab4788 Keep track of matching rules in compilation-mode
When matching messages in compilation-mode, keep track of the rule
employed for each match.  This facilitates debugging and allows us to
verify that each test case really exercises the rule that we expect it
to.

Naturally this uncovered several test cases that didn't check what the
author thought they did; the rules affixed to
compile-tests--test-regexps-data are those actually used, so that the
tests still pass.

* lisp/progmodes/compile.el (compilation--message): Add 'rule' slot.
(compilation-directory-properties, compilation-error-properties)
(compilation-internal-error-properties, compilation-parse-errors)
(compilation--compat-parse-errors): Set the rule slot.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-tests--grep-regexp-testcases)
(compile-tests--grep-regexp-tricky-testcases): Add rules to test cases.
(compile--test-error-line): Check that the rule matches what we expect.
(compile-test-grep-regexps): Adapt to test case format.
Remove now superfluous ert-info.
2020-10-19 13:00:14 +02:00
dickmao
8cdbd84ebe `ffap-gopher-at-point' interminable without newlines
* lisp/ffap.el (ffap-gopher-at-point): Stop when we get to the end
of the buffer.
* test/lisp/ffap-tests.el (ffap-test-no-newlines): Ensure
termination for corner case (bug#44048).
2020-10-19 11:56:49 +02:00
Harald Jörg
fb26dc130d cperl-mode: Delete a misleading comment, add tests for verification
* lisp/progmodes/cperl-mode.el: Delete a comment which explains a
bug which has been fixed a long time ago (bug#44073).
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-fontify-punct-vars): Add regression tests to verify
that fontification of punctuation variables doesn't start strings.
2020-10-19 10:57:57 +02:00
Stefan Kangas
ef5a604f08 Remove C version of substitute-command-keys
* src/doc.c (Fsubstitute_command_keys_old): Remove.
(syms_of_doc): Remove defsubr for Fsubstitute_command_keys_old.
* src/keymap.c (describe_map, describe_map_tree)
(describe_map_compare, describe_map_elt): Remove.
* src/keymap.h: Remove 'describe_map_tree'.
* test/lisp/help-tests.el (with-substitute-command-keys-test)
(help-tests-substitute-command-keys/compare)
(help-tests-substitute-command-keys/compare-all):
Don't test the C version of 'substitute-command-keys' removed
above.
2020-10-18 17:25:23 +02:00
Stefan Kangas
647b1c5142 Translate describe_map to Lisp
Third step in converting substitute-command-keys to Lisp.

* lisp/help.el (describe-map): New Lisp version of describe_map.
(help--describe-map-compare, help--describe-translation)
(help--describe-command, help--shadow-lookup): New helper
functions for describe-map.
(help--keymaps-seen, help--previous-description-column): New
variables.
* src/keymap.c
(Fkeymap__get_keyelt): New defun to expose get_keyelt to Lisp.
(Fdescribe_map_tree_old, Fdescribe_map): Remove defuns.
(Fdescribe_vector_internal): New defun to expose describe_vector to
Lisp in a way usable by describe-map.
(syms_of_keymap): New defsubrs for Fkeymap__get_keyelt and
Fdescribe_vector_internal.  Remove defsubrs for Fdescribe_map_tree_old
and Fdescribe_map.  Remove 'help--keymaps-seen'.

* test/lisp/help-tests.el
(help-tests-substitute-command-keys/shadow): Extend test.
(help-tests-substitute-command-keys/test-mode)
(help-tests-substitute-command-keys/compare-all)
(help-tests-describe-map-tree/no-menu-t)
(help-tests-describe-map-tree/no-menu-nil)
(help-tests-describe-map-tree/mention-shadow-t)
(help-tests-describe-map-tree/mention-shadow-nil)
(help-tests-describe-map-tree/partial-t)
(help-tests-describe-map-tree/partial-nil): New tests.
2020-10-18 17:25:19 +02:00
Stefan Kangas
dcf9cd47ae Add new Lisp implementation of substitute-command-keys
This is only the first step towards a full Lisp implementation, and
does not remove the old C code.  On the contrary, it is partly based
on using the old C code, which is to be replaced in steps.  This also
makes it easy to test that it produces the same output as the old.

* src/doc.c (Fsubstitute_command_keys_old): Rename from
Fsubstitute_command_keys.
(Fget_quoting_style): New defun to expose text_quoting_style to Lisp.
(syms_of_doc): Expose above symbols.
* lisp/help.el (substitute-command-keys): New Lisp version of
substitute-command-keys.  (Bug#8951)

* src/keymap.c
(Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp.
(syms_of_keymap): New defsubr for Fdescribe_map_tree.

* src/keyboard.c (help_echo_substitute_command_keys):
* src/doc.c (Fdocumentation, Fdocumentation_property):
* src/print.c (print_error_message):
* src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new
Lisp implementation of substitute-command-keys.

* test/src/doc-tests.el: Remove file.
* test/lisp/help-tests.el: Add tests for substitute-command-keys
copied from above file.
2020-10-18 17:23:24 +02:00
Mattias Engdegård
9bc5c016a1 Strengthen js-mode indentation tests
Test not only that the indentation engine is idempotent but that it
will indent a file to the expected shape from scratch.

* test/lisp/progmodes/js-tests.el (js-tests--remove-indentation): New.
(js-deftest-indent): Extend test.
2020-10-18 15:54:02 +02:00
Stefan Kangas
335e3cf89f Convert manual js indent tests to unit tests
* test/lisp/progmodes/js-tests.el (ert-x): Require.
(js-deftest-indent): New macro.  Use it to define tests for indenting
the below files.

* test/manual/indent/js-chain.js:
* test/manual/indent/js-indent-align-list-continuation-nil.js:
* test/manual/indent/js-indent-init-dynamic.js:
* test/manual/indent/js-indent-init-t.js:
* test/manual/indent/js.js:
* test/manual/indent/jsx-align-gt-with-lt.jsx:
* test/manual/indent/jsx-comment-string.jsx:
* test/manual/indent/jsx-indent-level.jsx:
* test/manual/indent/jsx-quote.jsx:
* test/manual/indent/jsx-self-closing.jsx:
* test/manual/indent/jsx-unclosed-1.jsx:
* test/manual/indent/jsx-unclosed-2.jsx:
* test/manual/indent/jsx.jsx: Move from here...
* test/lisp/progmodes/js-resources/js-chain.js:
* test/lisp/progmodes/js-resources/js-indent-align-list-continuation-nil.js:
* test/lisp/progmodes/js-resources/js-indent-init-dynamic.js:
* test/lisp/progmodes/js-resources/js-indent-init-t.js:
* test/lisp/progmodes/js-resources/js.js:
* test/lisp/progmodes/js-resources/jsx-align-gt-with-lt.jsx:
* test/lisp/progmodes/js-resources/jsx-comment-string.jsx:
* test/lisp/progmodes/js-resources/jsx-indent-level.jsx:
* test/lisp/progmodes/js-resources/jsx-quote.jsx:
* test/lisp/progmodes/js-resources/jsx-self-closing.jsx:
* test/lisp/progmodes/js-resources/jsx-unclosed-1.jsx:
* test/lisp/progmodes/js-resources/jsx-unclosed-2.jsx:
* test/lisp/progmodes/js-resources/jsx.jsx: ...to here.
2020-10-18 02:28:22 +02:00
Stefan Kangas
61e51fee9c Base bookmark-bmenu-mode on tabulated-list-mode (Bug#39293)
Rewriting bookmark-bmenu-mode to be based on 'tabulated-list-mode'
allows us to greatly simplify the code in several cases.  In addition,
we get some features for free, such as sorting by column.

The only functional step backwards is that we no longer support the
optional "inline" header line, a bookmark.el-specific feature to have
a header without using 'header-line-format'.  This feature is believed
to be not very useful or widely used.

* lisp/bookmark.el (tabulated-list): Require.
(bookmark-bmenu-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.
(bookmark-bmenu-mode-map): Inherit from 'tabulated-list-mode-map'
instead of 'special-mode-map'.  Remove now duplicate key bindings.
(bookmark-bmenu--revert): New function to show the bookmark list using
'tabulated-list-mode'.
(bookmark-bmenu-list): Simplify by using above new function.
(bookmark-bmenu-bookmark): Adapt to 'tabulated-list-mode'.
(bookmark-bmenu--name-predicate)
(bookmark-bmenu--file-predicate): New functions used by
'tabulated-list-mode' to sort.

(bookmark-bmenu-set-header): Redefine as obsolete function alias for
'tabulated-list-init-header'.
(bookmark-bmenu-toggle-filenames, bookmark-bmenu-show-filenames)
(bookmark-bmenu-hide-filenames, bookmark-bmenu-mark)
(bookmark-bmenu-mark-all, bookmark-bmenu-unmark-all)
(bookmark-bmenu-delete-all, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-delete-backwards): Simplify now
that we can depend on 'tabulated-list-mode' to do more work.

(bookmark-bmenu-use-header-line)
(bookmark-bmenu-inline-header-height): Declare variables relating to
the now unsupported "inline" header obsolete.
(bookmark-bmenu-ensure-position)
(bookmark-bmenu-execute-deletions): Remove code to handle "inline" header.

* test/lisp/bookmark-tests.el
(bookmark-test-bmenu-edit-annotation/show-annotation)
(bookmark-test-bmenu-unmark, bookmark-test-bmenu-mark): Update tests
for minor changes when using 'tabulated-list-mode'.
2020-10-17 17:56:44 +02:00
Stefan Kangas
39a001451f * test/lisp/mail/rfc822-tests.el: New file. 2020-10-17 15:55:42 +02:00
Andrea Corallo
d5791ba5fe Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-17 08:00:34 +02:00
Michael Albinus
6a2f56db4e Make last change in tramp-archive-tests.el backward compatible
* test/lisp/net/tramp-archive-tests.el (ert-resource-directory-format)
(ert-resource-directory-trim-left-regexp)
(ert-resource-directory-trim-right-regexp, ert-resource-directory)
(ert-resource-file): Define if they don't exist.
2020-10-16 16:51:25 +02:00
Eli Zaretskii
0b0297ad60 Fix file-name problems in several tests
* test/lisp/saveplace-tests.el
(saveplace-test-forget-unreadable-files):  Use file-truename, to
avoid false negatives when file names are not 'equal' as strings,
but point to the same file.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env)
(edebug-tests-run-macro):
* test/lisp/emacs-lisp/testcover-tests.el
(testcover-tests-markup-region, testcover-tests-run-test-case):
Bind find-file-suppress-same-file-warnings to  a non-nil value, to
avoid warnings about "same-file-names", at least on MS-Windows,
due to 8+3 aliases.
2020-10-16 16:49:47 +03:00
Stefan Kangas
1f44a77672 Use new resource directory macros in tests (Bug#43792)
* test/lisp/bookmark-tests.el (bookmark-tests-data-dir):
* test/lisp/calendar/todo-mode-tests.el (todo-test-data-dir):
* test/lisp/net/dbus-tests.el (dbus--tests-dir):
* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-sample-code-file):
* test/lisp/emacs-lisp/package-tests.el
(package-test-fake-contents-file):
* test/lisp/emacs-lisp/shadow-tests.el (shadow-tests-data-directory):
* test/lisp/emacs-lisp/testcover-tests.el
(testcover-tests-file-dir, testcover-tests-test-cases):
* test/lisp/mail/uudecode-tests.el (uudecode-tests-data-dir):
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test-resource-directory):
* test/lisp/pcmpl-linux-tests.el (pcmpl-linux-tests-data-dir):
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-tests-data-directory):
* test/lisp/progmodes/flymake-tests.el
(flymake-tests-data-directory):
* test/lisp/progmodes/ruby-mode-tests.el (ruby-mode-tests-data-dir):
* test/lisp/saveplace-tests.el (saveplace-tests-dir):
* test/lisp/textmodes/css-mode-tests.el (css-mode-tests-data-dir):
Remove.

* test/lisp/bookmark-tests.el (bookmark-tests-bookmark-file)
(bookmark-tests-example-file, bookmark-tests-bookmark-file-list):
* test/lisp/calendar/todo-mode-tests.el (todo-test-file-1)
(todo-test-archive-1, with-todo-test, todo-test--add-file):
* test/lisp/custom-tests.el (custom--test-theme-variables):
* test/lisp/net/dbus-tests.el (dbus--test-introspect):
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-setup-code-file):
* test/lisp/emacs-lisp/package-tests.el (package-test-data-dir)
(package-test-desc-from-buffer, package-test-install-single)
(package-test-macro-compilation)
(package-test-install-prioritized)
(package-test-install-multifile, package-test-update-archives)
(package-test-update-archives-async)
(package-test-update-archives/ignore-nil-entry)
(package-test-signed, package-x-test-upload-buffer)
(package-x-test-upload-new-version):
* test/lisp/emacs-lisp/shadow-tests.el (shadow-case-insensitive):
* test/lisp/emacs-lisp/testcover-tests.el
(testcover-tests-build-test-cases):
* test/lisp/mail/uudecode-tests.el (uudecode-tests-encoded-str)
(uudecode-tests-decoded-str):
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test-file-archive)
(tramp-archive-test-directory):
* test/lisp/pcmpl-linux-tests.el (pcmpl-linux-test-fs-types)
(pcmpl-linux-test-mounted-directories):
* test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-10483)
(cperl-mode-test-indent-styles):
* test/lisp/progmodes/flymake-tests.el
(flymake-tests--call-with-fixture):
* test/lisp/progmodes/ruby-mode-tests.el
(ruby--indent/converted-from-manual-test):
* test/lisp/saveplace-tests.el
(saveplace-test-save-place-to-alist/dir)
(saveplace-test-load-alist-from-file):
* test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): Adjust
to use new resource directory macros.
2020-10-16 11:28:09 +02:00
Stephen Berman
7543d5f173 Adjust some tests so that they work in symlinked environs
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defsubst):
* test/lisp/emacs-lisp/cl-generic-tests.el
(cl-generic-tests--method-files--finds-methods): Adjust test so
that they work in a symlinked environment (bug#43004).
(cl-generic-tests--method-files--finds-methods): Use file-truename
so that this works in a symlinked environment (bug#43004).
2020-10-16 10:33:19 +02:00
Basil L. Contovounesios
a950a6e6cf Substitute command keys in button help-echo values
* lisp/button.el (button--help-echo): Pass resulting string through
substitute-command-keys for consistency with show-help-function.
* test/lisp/button-tests.el (button-tests--map): New test keymap.
(button--help-echo-string, button--help-echo-form)
(button--help-echo-function): Use it to test command key
substitution in help-echo strings (bug#43070).
2020-10-16 09:32:48 +02:00
Lars Ingebrigtsen
a38002cecd Make Gnus more liberal when interpreting Face headers again
* lisp/gnus/gnus-fun.el (gnus-convert-face-to-png): Do it.

* lisp/gnus/gnus-util.el (gnus-base64-repad): Allow not checking
anything, but just repadding.
2020-10-15 08:39:00 +02:00
Andrea Corallo
f8505fd3d4 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-14 11:04:55 +02:00
Andrea Corallo
e9c150b5c2 * Add a test to verify form native compilation.
* test/src/comp-tests.el (comp-deftest): Fix typo.
	(compile-forms): New test.
2020-10-14 11:04:36 +02:00
Andrea Corallo
4f0e879030 Rework `native-compile' interface so it can return compiled functions
* lisp/emacs-lisp/comp.el (native-compile): Return the compiled
	function when the input is a symbol or a form.
	* test/src/comp-tests.el (free-fun, tco, fw-prop): Update tests
	for new `native-compile' interface.
2020-10-14 11:04:36 +02:00
Mattias Engdegård
cf40795888 Calc: allow infinite binary word size (bug#43764)
Setting the word size ("b w") to 0 removes the word size clipping for
all bit operations (effectively as if a word size of -∞ had been set).
Rotation is disallowed; logical and arithmetic shifts behave
identically.

After a suggestion by Vincent Belaïche.

* lisp/calc/calc-bin.el (calc-word-size, math-binary-arg)
(math-binary-modulo-args, calcFunc-lsh, calcFunc-ash, calcFunc-rot)
(math-clip, math-format-twos-complement): Allow a word size of 0,
meaning -∞.
* test/lisp/calc/calc-tests.el
(calc-tests--not, calc-tests--and, calc-tests--or, calc-tests--xor)
(calc-tests--diff): New functions.
(calc-tests--clip, calc-tests--rot, calc-shift-binary): Extend to
cover word size 0.
(calc-bit-ops): New test.
* doc/misc/calc.texi (Binary Functions): Update manual.
* etc/NEWS: Announce the change.
2020-10-13 11:29:01 +02:00
Mattias Engdegård
add1314195 Calc: revert to old precedence of '/' in (La)TeX input mode
Make the '/' precedence higher than that of '+' and '-' again,
partially reverting fda9b316f8 (bug#43902).

* lisp/calc/calc-lang.el (tex): Change precedence of '/'.
* test/lisp/calc/calc-tests.el (calc-latex-input): New test.
2020-10-13 11:29:01 +02:00
Mattias Engdegård
721b8468d2 Calc: make tests less chatty
* test/lisp/calc/calc-tests.el (calc-extract-units, calc-convert-units)
(calc-matrix-determinant, calc-choose): Remove "Working..." messages.
(calc-tests--check-choose, calc-tests--explain-choose): Eliminate.
2020-10-13 11:17:35 +02:00
Lars Ingebrigtsen
12175a339e Allow creating unibyte strings from Emacs modules
* doc/lispref/internals.texi (Module Values): Document
make_unibyte_string (bug#34873).

* src/emacs-module.c (module_make_unibyte_string): New function.
(initialize_environment): Export it.

* src/module-env-25.h: Define it.

* test/data/emacs-module/mod-test.c (Fmod_test_return_unibyte):
Test it.

* test/src/emacs-module-tests.el (module/unibyte): Test it.
2020-10-13 06:51:06 +02:00
Michael Albinus
3ec6dcfab8 ; Fix dbus-tests.el formatting 2020-10-12 11:41:54 +02:00
Hugh Daschbach
2f92177f80 Add interface arg to D-Bus PropertiesChanged signal.
* lisp/net/dbus.el (dbus-register-property, dbus-property-handler):
Fix signal generation.  (Bug#43936)

* test/lisp/net/dbus-tests.el (dbus-test06-register-property-emits-signal):
Fix test.
2020-10-12 11:37:27 +02:00
Stefan Kangas
4bda84da2e Convert url-domsuf.el tests to ert
* lisp/url/url-domsuf.el: Move commented out tests from here...
* test/lisp/url/url-domsuf-tests.el: ...to this new file.
2020-10-11 15:56:21 +02:00
Glenn Morris
0ed0dac0ca Merge from origin/emacs-27
c00606171f (origin/emacs-27) A better fix for bug#43886
3196fd44c3 Avoid crashes when a theme is loaded with one frame suspended
0407b15500 Removed an incorrectly placed extra word in the semantic docs
040dcbe53e Fix current-line hscrolling when overlays change
c56eeba2ce Extend tests for shell-command-dont-erase-buffer
2020-10-10 07:50:20 -07:00
Mattias Engdegård
1006eb1198 Improve coverage of Calc bit shift test
* test/lisp/calc/calc-tests.el (calc-tests--rsh, calc-tests--rash)
(calc-shift-binary): Test with negative word sizes.
2020-10-10 11:29:43 +02:00
Andrea Corallo
f7e7ff4fb1 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-10 11:00:35 +02:00
Stefan Kangas
b19bf08447 ; shorten https://lists.gnu.org/archive/html/... links 2020-10-09 12:23:02 +02:00
Stefan Kangas
95e8c7d1d9 ; Fix typos 2020-10-09 11:53:21 +02:00
Mattias Engdegård
35478f3f76 Calc: fix arithmetic right shift sign bit detection
Arithmetic right shift didn't compute the bit to shift in correctly.
For example, #x600000000 right-shifted 8 steps (with 32 bit word size)
resulted in #xff000000 rather than 0. (Bug#43764)

* lisp/calc/calc-bin.el (calcFunc-ash): Fix condition.
* test/lisp/calc/calc-tests.el (calc-tests--clip, calc-tests--lsh)
(calc-tests--rsh, calc-tests--ash, calc-tests--rash, calc-tests--rot):
New.
(calc-shift-binary): New test.
2020-10-09 11:24:15 +02:00
Nick Gasson
c69c17d573 Match OpenBSD doas password prompt in comint
* lisp/comint.el (comint-password-prompt-regexp): match OpenBSD doas
password prompt. OpenBSD 5.8 replaced sudo with doas in the base
install.

* test/lisp/comint-tests.el (comint-testsuite-password-strings): test
that the doas password prompt is matched (bug#43846).

Copyright-paperwork-exempt: yes
2020-10-09 06:57:07 +02:00
Michael Albinus
c56eeba2ce Extend tests for shell-command-dont-erase-buffer
* test/lisp/simple-tests.el
(simple-tests-shell-command-dont-erase-buffer): Extend test.

* test/lisp/net/tramp-tests.el
(tramp-test32-shell-command-dont-erase-buffer): Adapt test.  Tag
it :unstable.
2020-10-08 11:28:50 +02:00
Stefan Monnier
891248be1c * test/lisp/progmodes/ruby-mode-tests.el: Fix obsolete warnings 2020-10-06 22:08:19 -04:00
Mattias Engdegård
61113a3254 Suppress obsoletion warning in test of obsolete rx function
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Add byte-compilation
warning suppression.
2020-10-06 14:22:57 +02:00
Lars Ingebrigtsen
96f502496e Fix animate test that somehow changed recently 2020-10-06 03:51:17 +02:00
Lars Ingebrigtsen
9410c4e6b6 Fix mule-util-tests after recent truncation changes
* test/lisp/international/mule-util-tests.el: Fix truncation checks.
2020-10-06 03:48:00 +02:00
Harald Jörg
a14321ff69 cperl-mode: Fix a test to ensure cperl-mode is active
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-indent-exp): Make sure that cperl-mode is active
for testing 'cperl-indent-exp', also skip this test under
perl-mode.

* test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl:
Eliminate dependency on unrelated customizable variables (bug#10483).
2020-10-06 03:39:55 +02:00
Andrea Corallo
29f7024b6c * Fix a test in test/lisp/subr-tests.el
* test/lisp/subr-tests.el (subr-tests-bug22027): Redefine
	`read-string' with a lambda with the same number of arguments.
2020-10-05 21:33:04 +02:00
Andrea Corallo
f43dbe65ce Add a test for primitive redefinition
* test/src/comp-tests.el (primitive-redefine): New test.
	* test/src/comp-test-funcs.el (comp-test-primitive-redefine-f):
	New function.
2020-10-05 21:32:38 +02:00
Andrea Corallo
b3ade4de17 Revert "Use advice-flet' in place of cl-letf' to avoid primitive...
This reverts commit 825e85b393.
2020-10-05 21:32:35 +02:00
Michael Albinus
0a5a1adab9 * src/dbusbind.c (xd_signature): Better type check for array elements.
* test/lisp/net/dbus-tests.el (dbus-test01-compound-types): Extend test.
2020-10-05 13:58:28 +02:00
Stefan Monnier
14a5db2912 * src/xdisp.c (syms_of_xdisp): New var redisplay_skip_initial_frame.
This makes it possible to run most of the redisplay code (tho not the
actual drawing since there's nowhere to draw) even when there's no
real frame at hand, as is the case in batch mode.
This makes `xdisp-tests--minibuffer-resizing` work even in batch.

(redisplay_internal): Obey it.
(init_xdisp): Set `echo_area_window` even in noninteractive mode.
* src/dispnew.c (update_frame): Skip the initial frame.
* src/frame.c (make_frame): Use 80x25 as the default initial size.

* test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing):
Use the new var and fix use of `executing-kbd-macro`.
2020-10-04 22:50:38 -04:00
Andrea Corallo
44ef24342f Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-04 19:45:05 +02:00
Andrea Corallo
0373bb838a * Fix two tests in help-fns-tests.el for native code
* test/lisp/help-fns-tests.el (help-fns-test-lisp-defun)
	(help-fns-test-lisp-defsubst): Fix description string
	for native compiled functions.
2020-10-04 19:43:42 +02:00
Michael Albinus
96a8e84606 Make dbus-unregister-object work for monitors
* doc/misc/dbus.texi (Monitoring Messages): Rename from
"Monitoring Events".
(Register Objects, Monitoring Messages):
Mention returned object.

* lisp/net/dbus.el (dbus-unregister-object): Adapt docstring.
(dbus-unregister-object): Delete monitor if needed.
(dbus-register-monitor): Return proper object.

* src/dbusbind.c (dbus-registered-objects-table): Adapt docstring.

* test/lisp/net/dbus-tests.el (dbus--test-signal-handler):
Adapt docstring.
(dbus-test08-register-monitor): New test.
2020-10-04 18:56:45 +02:00
Stefan Kangas
d6a2754348 ; Fix more typos 2020-10-03 12:53:51 +02:00
Alan Mackenzie
d22fe0ec3a Enhance syntax-tests.el to test comments in parse-partial-sexp
This now tests the interface between parse-partial-sexp and the low level
comment function in syntax.c

* test/src/syntax-tests.el (syntax-comments-midpoint): New function.
(syntax-pps-comments): New macro.
(top level): Two new syntax-br-comments tests and five new syntax-pps-comments
tests.

* test/data/syntax-comments.txt (top level): Amend some test fragments and add
some more.
2020-10-02 21:21:06 +00:00
Mattias Engdegård
0ade20f49f Calc: fix formatting and parsing Unix time (bug#43759)
The number of days from epoch to Jan 1, 1970 that was used in parsing
and formatting Unix time was incorrect.  The previous fix
(in e368697ce3) was incomplete.

Reported by Vincent Belaïche.

* lisp/calc/calc-forms.el (math-unix-epoch): New constant.
(math-format-date-part, math-parse-standard-date, calcFunc-unixtime):
Use math-unix-epoch instead of a constant that is sometimes wrong.
* test/lisp/calc/calc-tests.el (calc-unix-date): New test.
2020-10-02 22:24:54 +02:00
Andrea Corallo
825e85b393 Use advice-flet' in place of cl-letf' to avoid primitive redefinition
* test/lisp/time-stamp-tests.el (with-time-stamp-system-name): Use
	`advice-flet' to advice primitive avoiding redefinition.

	* test/lisp/tempo-tests.el (tempo-p-element-test)
	(tempo-P-element-test, tempo-r-element-test)
	(tempo-s-element-test, tempo-r>-element-test): Likewise.

	* test/lisp/subr-tests.el (subr-tests-bug22027): Likewise.

	* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
	(shadow-test01-sites, shadow-test06-literal-groups)
	(shadow-test07-regexp-groups): Likewise.

	* test/lisp/replace-tests.el (replace-tests-with-undo): Likewise.

	* test/lisp/play/dissociate-tests.el
	(dissociate-tests-dissociated-press): Likewise.

	* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
	(tramp-test21-file-links): Likewise.

	* test/lisp/kmacro-tests.el (kmacro-tests-call-macro-hint-and-repeat)
	(kmacro-tests-repeat-on-last-key)
	(kmacro-tests-repeat-view-and-run)
	(kmacro-tests-bind-to-key-with-key-sequence-in-use): Likewise.

	* test/lisp/files-tests.el (files-tests-read-file-in-~): Likewise.

	* test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice):
	Likewise.

	* test/lisp/bookmark-tests.el (bookmark-test-bmenu-locate):
	Likewise.

	* test/lisp/abbrev-tests.el
	(inverse-add-abbrev-skips-trailing-nonword)
	(inverse-add-abbrev-skips-trailing-nonword/positive-arg)
	(inverse-add-abbrev-skips-trailing-nonword/negative-arg): Likewise.
2020-10-02 21:20:53 +02:00
Alan Mackenzie
6a64660318 Enhance syntax-tests.el to test comments in scan-lists
This now tests the interface between scan_lists and the comment functions.

* test/src/syntax-tests.el (syntax-br-comments): New macro.
({-in, ;-in, /*-in): Set parse-sexp-ignore-comments to t.
(top level): Add 15 tests for comments inside brace lists.

* test/data/syntax-comments.txt (top level): Amend some test fragments.
2020-10-02 17:25:02 +00:00
Glenn Morris
726eb835dd Merge from origin/emacs-27
78eacf31e8 ; Fix many typos in symbols in docs and comments
d5d12707d6 * doc/misc/flymake.texi (Using Flymake): Fix a typo.  (Bug...

# Conflicts:
#	lisp/allout.el
#	lisp/progmodes/ebrowse.el
2020-10-02 09:38:24 -07:00
Stefan Kangas
78eacf31e8 ; Fix many typos in symbols in docs and comments 2020-10-02 13:29:45 +02:00
Mattias Engdegård
4cb16b6f42 Calc: fix business days calculation (bug43677)
The calculation of business days was broken in 2012 (probably
310e60d945 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0.  Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.

Reported by Aaron Zeng.

* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology.  Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
2020-10-02 10:35:52 +02:00
Andrea Corallo
f345622152 Clean-up testsuite for vanilla builds
Tag all native compiler tests and skip them in vanilla builds

	* test/Makefile.in (SELECTOR_DEFAULT, SELECTOR_EXPENSIVE)
	(SELECTOR_ALL): Define selectors for vanilla or nativecomp builds.
	* test/src/comp-tests.el: Do not native compile test files on
	vanilla.
	(comp-deftest): New macro to define tests tagging as :nativecomp.
2020-10-02 10:24:32 +02:00
Lars Ingebrigtsen
6f36b67e41 Stop using a dynamically bound 'generated-autoload-file' variable
* doc/lispref/loading.texi (Autoload): Document change of name
(bug#39823).

* lisp/emacs-lisp/autoload.el (autoload-find-generated-file): Pass
the file name in.
(autoload-generated-file): Ditto.
(autoload-file-load-name): Ditto.
(generate-file-autoloads): Ditto.
(autoload--setup-output): Ditto.
(autoload-generate-file-autoloads): Ditto, and alter doc string to
reflect when `generated-autoload-file' is heeded.
(update-file-autoloads): Pass outfile in to functions.
(autoload-find-destination): Ditto.
(update-directory-autoloads): Make into an obsolete shim around
`make-directory-autoloads'.
(make-directory-autoloads): Renamed from
`update-directory-autoloads' with new semantics.
(batch-update-autoloads): Adjust caller.

* lisp/emacs-lisp/package.el (package-generate-autoloads): Adjust
caller.
2020-10-02 04:34:31 +02:00
Tino Calancha
29435ecd8e Fix bug in wdired-get-filename
* lisp/wdired.el (wdired-get-filename): Acknowledge the first
argument (bug#39280).
* test/lisp/wdired-tests.el (wdired-test-bug39280): Add test.
2020-10-01 23:34:01 +02:00
Alan Mackenzie
da591df90a Enhance syntax-tests.el to test some comment character handling.
* test/src/syntax-tests: Add a new section testing some aspects of comment
  handling in syntax.c.  This needs further enhancement.  It uses ....

* test/data/syntax-comments.txt: A new test file.
2020-10-01 20:35:40 +00:00
Michael R. Mauger
e274e3f44b 2020-03-29 Michael R. Mauger <michael@mauger.com>
* lisp/progmodes/sql.el (sql-add-product): Re-correct argument
       spec.  Previous change was due to my mistake; I have
       resolved back to the prior behavior (Bug#39960).
       * test/lisp/progmodes/sql-tests.el (sql-test-add-product): Added
       test to insure I don't make the same mistake again.
2020-10-01 20:34:55 +02:00
Andrea Corallo
ddf1b1931c * test/src/comp-tests.el (comp-tests-bootstrap): Tag it as expensive. 2020-10-01 18:04:00 +02:00
Stefan Kangas
af72f6d510 Silence byte-compiler in two tests
* test/lisp/obsolete/cl-tests.el (require):
* test/lisp/simple-tests.el (simple-test-count-words-bug-41761):
Silence byte-compiler.
2020-10-01 15:34:46 +02:00
Lars Ingebrigtsen
648de09e71 Remove mml-sec-test that assumes the first signature
This is no longer supported; the user is asked for what signature to
use.
2020-10-01 05:19:49 +02:00
Alex Bochannek
d11627a7ca Make gnus-base64-repad a bit stricter again
* lisp/gnus/gnus-util.el (gnus-base64-repad): Make the code a bit
stricter again.
2020-10-01 02:44:58 +02:00
Robert Pluim
7518596857 Query for the signer when sending signed mail (with unknown signer)
* lisp/gnus/mml-sec.el (mml-secure-sender-sign-query): New
function (bug#40118).
(mml-secure-epg-sign): Use it to determine the signer (bug#40118).

* lisp/gnus/mml-sec.el
(mml-secure-allow-signing-with-unknown-recipient): Remove.
2020-10-01 02:14:17 +02:00
Eli Zaretskii
a190a446ee Fix 'move-to-column' when invisible text follows a TAB
* src/indent.c (scan_for_column): Accept 2 more arguments, and
report through them the position corresponding to PREVCOL.  All
callers changed.
(Fmove_to_column): Use the prev_col's position to test for a TAB
instead of assuming that the TAB is just before point (which is
false when there's invisible text around).  (Bug#43587)

* test/src/indent-tests.el: New file.
2020-09-30 17:33:58 +03:00
Michael Albinus
b7224f9629 Stricter checks for D-Bus compound types.
* src/dbusbind.c (XD_DBUS_TYPE_P, Fdbus__init_bus)
(xd_read_queued_messages): Use Fkeywordp instead of SYMBOLP.
(xd_signature): Stricter checks for compound types.

* test/lisp/net/dbus-tests.el (dbus-test01-compound-types): Extend test.
2020-09-30 15:28:53 +02:00
Michael Albinus
17ecfa8698 Minor code cleanup in dbus-tests.el
* test/lisp/net/dbus-tests.el (dbus--tests-dir): Make it a defconst.
(dbus--test-method-reentry-handler): Mark args as unused.
(dbus-test04-method-reentry): Tag it :expensive-test.  Fix typo.
(dbus-test06-property-types): Remove duplicate test.
(dbus--test-introspect): Use `insert-file-contents-literally'.
(dbus--test-validate-property): Mark expected-annotations as unused.
(dbus--test-validate-m-or-s): Remove superfluous le-clause.
2020-09-30 12:40:08 +02:00
Hugh Daschbach
d5f9a07862 Add D-Bus method-call reentrant test
* test/lisp/net/dbus-tests.el (dbus--tests-method-reentry-handler):
New defun.
(dbus-test04-method-reentry): New test.  (Bug#43251)
2020-09-30 11:27:22 +02:00
Hugh Daschbach
2018090987 * test/lisp/net/dbus-tests.el: Add timeout tests.
(dbus-test04-call-method-timeout, dbus-test07-introspection-timeout):
New tests.
2020-09-30 11:23:24 +02:00
Hugh Daschbach
0bc19c17fd Add D-Bus introspection tests
* lisp/net/dbus.el (dbus-annotation-deprecated): New defconst.

* test/lisp/net/dbus-tests.el  (dbus--tests-dir): New defvar.
(dbus--test-introspect, dbus--test-validate-interface)
(dbus--test-validate-annotations, dbus--test-validate-property)
(dbus--test-validate-m-or-s, dbus--test-validate-signal)
(dbus--test-validate-method): New defuns.
(dbus-test07-introspection): New test.

* test/lisp/net/dbus-resources/org.gnu.Emacs.TestDBus.xml:
New test data.
2020-09-30 11:19:41 +02:00
Hugh Daschbach
7e581607e7 * test/lisp/net/dbus-tests.el: Add property tests. (Bug#43252)
(dbus--test-run-property-test, dbus--test-property): New defuns.
(dbus-test06-property-types): New test for property registration,
set, get.
2020-09-30 11:09:17 +02:00
Andrea Corallo
6eb5a8c492 Merge remote-tracking branch 'savannah/master' into clean-up 2020-09-30 09:09:39 +02:00
Lars Ingebrigtsen
1993c4e300 Fix gnus-base64-repad test failures 2020-09-30 05:05:09 +02:00
Michael Albinus
7e45ed3a96 More strict D-Bus type checking
* lisp/net/dbus.el (dbus-register-monitor): Register proper key.
(dbus-monitor-handler): Adapt docstring.  Use grave text-quoting-style.

* src/dbusbind.c (xd_signature, xd_append_arg): More strict tests.
(syms_of_dbusbind): Adapt docstring.

* test/lisp/net/dbus-tests.el (dbus-test01-basic-types): Extend test.
2020-09-29 19:43:02 +02:00
Alex Bochannek
eaf224f88d Repad the Face header in Gnus
* lisp/gnus/gnus-fun.el (gnus-convert-face-to-png): Use it.

* lisp/gnus/gnus-util.el (gnus-base64-repad): New function (bug#43441).
2020-09-28 14:09:07 +02:00
Jan Tatarik
232382415d Fix Gnus parsing of weekly recurring icalendar events
* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event:recurring-interval): Fix parsing of weekly
recurring events (bug#43669).

Example: in the absence of explicit INTERVAL value in the calendar
event, a weekly event with occurrences scheduled for Mondays and
Wednesdays should receive the default recurring interval of "1" and the
org mode timestamp repeater should be "+1w".

Due to a bug in the current code we receive "WEEKLY" and "+WEEKLYw"
instead. The patch fixes the issue.
2020-09-28 13:08:37 +02:00
Michael Albinus
4155ca273a Document D-Bus monitoring
* doc/misc/dbus.texi: Replace "symbol" by "keyword" where appropriate.
(Alternative Buses): Adapt dbus-init-bus description.
(Errors and Events): Adapt dbus-event structure.  New defuns
dbus-event-destination-name, dbus-event-handler and dbus-event-arguments.
(Monitoring Events): New node.

* lisp/net/dbus.el: Replace "symbol" by "keyword" where appropriate.
(cl-lib): Require.
(dbus-register-monitor): Adapt the argument list.
(dbus-monitor-handler): Extend.
(dbus-init-bus): Adapt docstring.

* test/lisp/net/dbus-tests.el (dbus-test01-compound-types):
Skip if needed.  Extend test.
2020-09-27 18:59:04 +02:00
Mattias Engdegård
8bd233a7eb Minor string-search optimisations (bug#43598)
* src/fns.c (Fstring_search): Perform cheap all-ASCII checks before more
expensive ones.  Use a faster loop when searching for non-ASCII
non-raw bytes.
* test/src/fns-tests.el (string-search): Add more test cases.
2020-09-27 14:28:07 +02:00
Mattias Engdegård
72e9ec96d0 ; * test/lisp/subr-tests.el (string-replace): Add more test cases 2020-09-27 13:32:27 +02:00
Lars Ingebrigtsen
8c569683f2 Fix searching for multibyte needles in unibyte haystacks
* src/fns.c (Fstring_search): Make this work better when searching
unibyte haystacks for multibyte needles (bug#43598).
2020-09-27 02:01:03 +02:00
Lars Ingebrigtsen
104688feb4 Add tiny optimization for string-search
* src/fns.c (Fstring_search): Add tiny optimization for needles
that are longer than the haystack (bug#43598).
2020-09-27 00:35:11 +02:00
Lars Ingebrigtsen
baf331e40c Rename replace-in-string to string-replace
* doc/lispref/searching.texi (Search and Replace): Update.
* lisp/bindings.el (mode-line-position): Update callers.

* lisp/subr.el (string-replace): Rename from replace-in-string
since that clashes with XEmacs' replace-in-string which is
equivalent to the Emacs replace-regexp-in-string (bug#43598).
2020-09-27 00:24:50 +02:00
Andrea Corallo
06acf681d6 Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-26 15:31:50 +02:00
Stefan Kangas
e00936bf9f Silence some byte-compiler warnings
* test/lisp/arc-mode-tests.el (arc-mode-test-archive-int-to-mode):
* test/lisp/custom-tests.el (cus-test-opts):
* test/lisp/help-fns-tests.el (foo-test-map)
(help-fns-test--describe-keymap-foo):
* test/src/fns-tests.el (w32-collate-ignore-punctuation)
(fns-tests-func-arity): Silence byte-compiler warnings.
2020-09-26 12:03:07 +02:00
Stefan Kangas
2dff3ea073 Repurpose libxml test for obsolete argument
* test/src/xml-tests.el (libxml-tests): Move half this test for the
recently obsoleted fourth argument to libxml-parse-xml-region...
* test/lisp/xml-tests.el (xml-tests--remove-comments): ...to a new
test here for xml-remove-comments.

* test/src/xml-tests.el (libxml-tests--data-comments-discarded):
Move test data from here...
* test/lisp/xml-tests.el (xml-tests--data-with-comments): ...to here.
2020-09-26 11:48:09 +02:00
Glenn Morris
d58e3b3997 Fix out-of-tree make check
* test/lisp/custom-tests.el (custom-test-admin-cus-test): New const.
(check-for-wrong-custom-types): Use it.
2020-09-25 11:01:14 -07:00
Paul Eggert
cc7f971485 Fix out-of-source ‘make check’ emacs-module-tests
Problem reported by Koki Fukuda in:
https://lists.gnu.org/r/emacs-devel/2020-07/msg00169.html
* test/Makefile.in (MODULE_CFLAGS):
Include from the same directories included from in ../src.
* test/src/emacs-module-tests.el (module/describe-function-1):
Strip path to source directory.

(cherry picked from commit c86f3fe0d0)
2020-09-25 10:33:27 -07:00
Mattias Engdegård
497a1ed8bb string-search robustness and documentation improvement (bug#43598)
* src/fns.c (Fstring_search): Check START-POS argument range.
Simplify logic.  Improve doc string.
* test/src/fns-tests.el (string-search): Add test cases.
* doc/lispref/strings.texi (Text Comparison): Elaborate.
* lisp/emacs-lisp/byte-opt.el (pure-fns): Mark string-search as pure.
2020-09-25 17:08:00 +02:00
Lars Ingebrigtsen
664927b525 Add an expensive test for defcustom types
* admin/cus-test.el (cus-test-opts): Return the tests.

* test/lisp/custom-tests.el (check-for-wrong-custom-types): Test
custom types (bug#30990).
2020-09-25 14:46:36 +02:00
Mattias Engdegård
8a253a96a0 Fix replace-in-string infloop with empty pattern string (bug#43598)
* lisp/subr.el (replace-in-string): Raise an error if FROMSTRING is
empty.
* test/lisp/subr-tests.el (replace-in-string): Add test case.
2020-09-25 13:15:42 +02:00
Lars Ingebrigtsen
09adf92644 Fix previous replace-in-string rewrite
* lisp/subr.el (replace-in-string): Fix logic errors in previous
patch.
2020-09-25 02:07:05 +02:00
Lars Ingebrigtsen
7f9ad5980c Fix replace-in-string multibyteness problems with string-search
* lisp/subr.el (replace-in-string): Simplify by using the new
string-search function (bug#43598).
2020-09-25 01:53:16 +02:00
Lars Ingebrigtsen
e51a98b0c2 Add a new function 'string-search'
* doc/lispref/strings.texi (Text Comparison): Document it.
* src/fns.c (Fstring_search): New function.
2020-09-25 01:53:16 +02:00
Glenn Morris
976b8464fb Update a failing lisp test
* test/lisp/emacs-lisp/lisp-tests.el (up-list-no-cross-string):
Update for recent "Don't signal scan-error" change.
2020-09-24 12:46:19 -07:00
Glenn Morris
9bf9f699b1 Add skip condition for some dbus tests
* test/lisp/net/dbus-tests.el (dbus-test01-type-conversion)
(dbus-test01-basic-types): Add skip for hydra.nixos.org failures.
; Standardize license notice
2020-09-24 11:47:11 -07:00
Andrea Corallo
0cc1804d42 Add a test for primitive advicing effectiveness
* test/src/comp-test-funcs.el (comp-test-primitive-advice-f): New
	function.
	* test/src/comp-tests.el (comp-test-primitive-advice): New test.
2020-09-24 09:57:17 +02:00
Stefan Kangas
ad285e0eb8 Remove TODO to convert files to unit tests
* test/lisp/textmodes/css-mode-tests.el:
* test/lisp/progmodes/ruby-mode-tests.el: Remove TODO to convert test
files into unit tests.  The files are still useful for debugging.
Ref: https://lists.gnu.org/r/emacs-devel/2020-09/msg01906.html
2020-09-23 20:53:06 +02:00
Stefan Kangas
37a2a427e4 Convert some completion.el tests to ERT
* test/lisp/completion-tests.el: New file.
* lisp/completion.el: Move commented out tests to completion-tests.el.
2020-09-23 20:03:19 +02:00
Stefan Kangas
610b771d4a Convert allout unit tests to ERT
* test/lisp/allout-tests.el: New file.
* lisp/allout.el (allout-run-unit-tests-on-load)
(allout-run-unit-tests): Remove.
(allout-tests-obliterate-variable)
(allout-tests-globally-unbound, allout-tests-globally-true)
(allout-tests-locally-true, allout-test-resumptions): Move to
allout-tests.el

* test/lisp/allout-widgets-tests.el: New file.
* lisp/allout-widgets.el (allout-widgets-run-unit-tests-on-load)
(allout-widgets-run-unit-tests): Remove.
(allout-test-range-overlaps): Move to allout-widgets-tests.el.
2020-09-23 20:03:19 +02:00
Michael Albinus
441e875019 * test/lisp/net/dbus-tests.el (dbus-test01-basic-types): Adapt test. 2020-09-23 19:57:03 +02:00
Mauro Aranda
b252e09ae4 Allow the newline character in the character widget (Bug#15925)
* lisp/wid-edit.el (widget-specify-field): Extend check for adding the
boundary overlay.  Plus, a minor comment indentation fix.
(character widget): Tweak the valid-regexp to allow the newline
character.

* test/lisp/wid-edit-tests.el (widget-test-character-widget-value)
(widget-test-editable-field-widget-value): New tests (bug#15925).
2020-09-23 15:45:36 +02:00
Stefan Monnier
83a4e4c2a9 test/src/xdisp-tests.el: New file 2020-09-22 23:55:45 -04:00
martin rudalics
10696d0ac5 Make delete-pair only delete pairs that are part of insert-pair-alist
* lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that
are part of `insert-pair-alist' (bug#4136).
2020-09-22 16:44:15 +02:00
Mattias Engdegård
3376b08c2e ; * test/lisp/progmodes/ps-mode-tests.el: Add missing backslash 2020-09-22 12:32:12 +02:00
Stefan Kangas
2788557000 Support shellcheck in compilation-mode
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Add shellcheck regexp.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
(compile-test-error-regexps): Add test for shellcheck.
* etc/compilation.txt: Add shellcheck example.
* etc/NEWS: Announce the change.

foo
2020-09-22 02:44:47 +02:00
Stefan Kangas
9a3a2a00da Remove some unnecessary compat code
* test/lisp/emacs-lisp/ert-x-tests.el (ert-test-describe-test):
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Remove unnecessary compat code; these tests should never need to run
on older versions of Emacs.
2020-09-22 01:00:06 +02:00
Andrea Corallo
5a8be1719a Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-21 21:45:02 +02:00
Stefan Kangas
9fff5491c3 Convert a manual test for nxml-mode to unit test
* test/manual/indent/nxml.xml: Delete file.
* test/lisp/nxml/nxml-mode-tests.el
(nxml-mode-test-comment-bug-17264): New test based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
b63c3535b0 Convert manual indent test for ruby-mode into unit test
* test/manual/indent/ruby.rb: Move from here...
* test/lisp/progmodes/ruby-mode-resources/ruby.rb: ...to here.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-mode-tests-data-dir): New variable.
(ruby--indent/converted-from-manual-test): New test.
2020-09-21 18:47:55 +02:00
Stefan Kangas
1d98bed6c3 Convert manual indent test for scheme-mode into unit test
* test/manual/indent/scheme.scm: Delete file.
* test/lisp/progmodes/scheme-tests.el: New file with unit test for
scheme-mode based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
01f7fdb2a0 Convert manual indent test for ps-mode into unit test
* test/manual/indent/ps-mode.ps: Delete file.
* test/lisp/progmodes/ps-mode-tests.el (ps-mode-test-indent):
New unit test based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
d5d642eb71 Convert manual indent test for opascal-mode into unit test
* test/manual/indent/opascal.pas: Delete file.
* test/lisp/progmodes/opascal-tests.el: New file with unit test for
oposcal-mode based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
31cb935cd7 Convert manual indent test for lisp-mode into unit test
* test/manual/indent/lisp.lisp: Delete file.
* test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-defun):
New unit test based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
f3e2d3418a Convert manual indent test for elisp-mode into unit test
* test/manual/indent/elisp.el: Delete file.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-indent-basic):
New unit test based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
12ca463833 ; * test/lisp/textmodes/css-mode-tests.el: Add TODO. 2020-09-21 16:46:21 +02:00
Stefan Kangas
ebad35e4d9 ; Fix more trivial typos 2020-09-21 15:51:07 +02:00
Stefan Kangas
462dbc1cb2 ; Fix typos 2020-09-21 14:26:42 +02:00
Michael Albinus
63f9d9af81 Add D-Bus tests
* doc/misc/dbus.texi (Type Conversion): Precise basic type values.

* lisp/net/dbus.el (dbus-register-property): Send signal directly.

* src/dbusbind.c (xd_signature): Accept non-nil objects for
DBUS_TYPE_BOOLEAN.

* test/lisp/net/dbus-tests.el (dbus-test01-basic-types)
(dbus-test01-compound-types): New tests.
2020-09-21 13:41:30 +02:00
Glenn Morris
3675993d76 Merge from origin/emacs-27
df04f3e755 Fix a rare segfault in syntax.c
fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a ...
fcd599bbea Minor copyedits of doc of 'with-silent-modifications'
759399cdb1 Improve documentation of 'max-mini-window-height'
3223302aa2 Use modern constant names for the NS pasteboard
985703d380 Fix doc string of 'toggle-menu-bar-mode-from-frame'
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)

# Conflicts:
#	lisp/emacs-lisp/syntax.el
#	src/syntax.c
2020-09-20 17:18:16 -07:00
Michael Albinus
f8624fb834 Make D-Bus properties type safe
* doc/misc/dbus.texi (Properties and Annotations):
Precise dbus-get-property and dbus-set-property.
(Type Conversion): Explain :byte and :boolean type conversion.
(Errors and Events): dbus-ignore-errors returns nil when there is
a D-Bus error.  Remove dbus-show-dbus-errors.

* etc/NEWS: Some D-Bus relevant changes.

* lisp/net/dbus.el (dbus-show-dbus-errors): Remove.
(dbus-ignore-errors): Replay implamentation without that variable.
(dbus-check-arguments): New defun.
(dbus-list-activatable-names, dbus-list-names)
(dbus-list-queued-owners, dbus-get-name-owner, dbus-introspect)
(dbus-get-all-properties, dbus-get-all-managed-objects): Don't debug.
(dbus-get-property, dbus-set-property): Propagate errors.
(dbus-register-property): Check for valid VALUE.
(dbus-property-handler): Simplify.

* src/dbusbind.c (Fdbus_message_internal): Adapt docstring.
Handle DBUS_MESSAGE_TYPE_INVALID.

* test/lisp/net/dbus-tests.el (dbus-show-dbus-errors): Don't declare.
(dbus-test06-register-property)
(dbus-test06-register-property-emits-signal): Adapt tests.
2020-09-20 16:44:17 +02:00
Kévin Le Gouguec
f8d8d28bc6 Tweak dired warning about "wildcard" characters
* lisp/dired-aux.el (dired-isolated-string-re): Use explicitly
numbered groups.
(dired--star-or-qmark-p): Add START parameter.  Make sure to
return the first isolated match.
(dired--need-confirm-positions, dired--mark-positions)
(dired--highlight-no-subst-chars, dired--no-subst-explain)
(dired--no-subst-ask, dired--no-subst-confirm): New functions.
(dired-do-shell-command): Use them (bug#28969, bug#35564).

* test/lisp/dired-aux-tests.el (dired-test-bug27496): Adapt to
new prompt.
(dired-test--check-highlighting): New test helper.
(dired-test-highlight-metachar): New tests.
2020-09-20 14:16:19 +02:00
dickmao
321bba0c99 Terminate `comint-password-function' tests
* test/lisp/comint-tests.el (comint-test-no-password-function)
(comint-test-password-function-with-value)
(comint-test-password-function-with-nil): refactor
(comint-tests/test-password-function): actually test
`comint-send-invisible' and inhibit inadvertent interactive query
(bug#38825).
2020-09-20 12:43:37 +02:00
Lars Ingebrigtsen
3ec7005315 Tweak a hash table print test 2020-09-20 12:26:29 +02:00
Pip Cet
988f45a75b Fix printing of hash tables with removed elements
* src/print.c (print_vectorlike): Keep track of the actual number
of elements printed rather than attempting to use hash bucket
indices (bug#38892).
2020-09-20 12:24:16 +02:00
Mauro Aranda
1278a9a907 New command: revert-buffer-with-fine-grain
* doc/emacs/files.texi (Reverting): Document the new command and the
new variable.

* etc/NEWS: Mention the new command and the new variable.

* lisp/files.el (revert-buffer-with-fine-grain): New command.  Revert
a buffer trying to be non-destructive, by using replace-buffer-contents.
(revert-buffer-insert-file-contents-delicately): New function, alternative
to revert-buffer-insert-file-contents-function--default-function.
(revert-buffer-with-fine-grain-max-seconds): New variable.  Passed as
argument MAX-SECS of replace-buffer-contents.

* test/lisp/files-tests.el (files-tests-lao files-tests-tzu): Helper
variables, taken from diffutils manual, to test reverting a buffer.
(files-tests-revert-buffer)
(files-tests-revert-buffer-with-fine-grain): New tests (bug#18).
2020-09-20 01:04:39 +02:00
Daniel Martín
c9f845a53c Put files in mhtml-mode when they have <!DOCTYPE, case-insensitive
* lisp/files.el (magic-fallback-mode-alist): Match "DOCTYPE" in a
case-insensitive way before putting files in mhtml-mode. See
https://html.spec.whatwg.org/multipage/syntax.html#the-doctype for the
standard reference.
* test/lisp/files-tests.el (files-test-magic-mode-alist-doctype): Add
a test (bug#43511).
2020-09-19 19:15:48 +02:00
Michael Albinus
b23beef3f2 Fix error in D-Bus test
* test/lisp/net/dbus-tests.el (dbus-test04-register-method):
Do not check for error message text.
(dbus--test-signal-handler): Fix docstring.
(dbus--test-timeout-handler): New defun.
(dbus-test05-register-signal)
(dbus-test06-register-property-emits-signal): Use it.
2020-09-18 11:17:42 +02:00
Harald Jörg
f7e68759d0 cperl-mode: Add new value "PBP" for 'cperl-set-style'
* lisp/progmodes/cperl-mode.el (cperl-style-alist)
(cperl-set-style): Add indentation style recommended by Damian Conway's
book "Perl Best Practices".

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-indent-styles): Add a test to verify indentation
and unraveling of conditionals (bug#43457).
2020-09-17 17:35:11 +02:00
Michael Albinus
6d6ef7b1d0 Work on D-Bus properties etc
* lisp/net/dbus.el (seq, subr-x): Require.
(dbus-error-disconnected, dbus-error-service-unknown): New defconst.
(dbus-set-property, dbus-register-property): Use `keywordp'.  Fix
proper value sending a signal.

* test/lisp/net/dbus-tests.el (dbus-test04-register-method):
Extend test.
(dbus--test-signal-received): New defvar.
(dbus--test-signal-handler): New defun.
(dbus-test05-register-signal)
(dbus-test06-register-property-emits-signal): New tests.
(dbus-test06-register-property)
(dbus-test06-register-property-several-paths): Rename tests.
2020-09-17 17:13:55 +02:00
Tino Calancha
23a3333b3e Give Lisp control on the lossage size
Add a command 'lossage-size' to set the maximum
number or recorded keystrokes (Bug#38796).

* src/keyboard.c (lossage_limit):
Static variable with the current lossage size limit.
(MIN_NUM_RECENT_KEYS): Renamed from NUM_RECENT_KEYS.
Set it as 100 and use it as the minimum value for lossage_limit.
Keep the same default for the vector size as before (300).
(lossage-size): New command.
(update_recent_keys): Helper function.
(command_loop_1)
(record_char)
(recent-keys)
(syms_of_keyboard): Use lossage_limit as the vector size.

* lisp/help.el (view-lossage): Mention the new command in the docstring.
* etc/NEWS (Changes in Emacs 28.1): Announce this change.
* doc/emacs/help.texi (Misc Help): Update manual.
* test/src/keyboard-tests.el (keyboard-lossage-size): Add test.
2020-09-17 16:32:18 +02:00
Lars Ingebrigtsen
0a7152e095 Fix up previous replace-in-string commit
* lisp/subr.el (replace-in-string): Fix thinko in implementation.
2020-09-15 17:36:36 +02:00
Lars Ingebrigtsen
caf64ae08b Add new, simple `replace-in-string' function
* lisp/subr.el (replace-in-string): New, side-effect-free function.

* doc/lispref/searching.texi (Search and Replace): Document it.
2020-09-15 17:15:59 +02:00
Andrea Corallo
5f37c18581 * test/src/comp-tests.el (comp-tests-bootstrap): Print compilation time. 2020-09-14 23:06:42 +02:00
Stefan Monnier
e408f2fab2 * test/lisp/emacs-lisp/find-func-tests.el: New file (for bug#43393)
* lisp/emacs-lisp/ert-x.el (ert-simulate-keys): New macro.

* test/lisp/international/mule-tests.el
(mule-cmds--test-universal-coding-system-argument): Use it and enable
the test also in batch mode.
2020-09-14 16:04:22 -04:00
Mattias Engdegård
0e00f199cd Calc: fix binomial coefficients for negative arguments (bug#16999)
For some values outside integers 0≤k≤n, (n choose k) gave wrong
results, entered infinite recursion or used unreasonably amounts of
stack space.  This change fixes that and extends the function to all
integer arguments using the definitions from M. J. Kronenburg
(https://arxiv.org/abs/1105.3689).

* lisp/calc/calc-comb.el (calcFunc-choose):
Fix sign error to prevent infinite recursion and extend function to
handle all integer arguments.
(math-choose-iter, math-choose-float-iter): Rewrite in iterative form;
no TCO in elisp yet.
* test/lisp/calc/calc-tests.el (calc-tests--fac, calc-tests--choose)
(calc-tests--check-choose, calc-tests--explain-choose)
(calc-tests--calc-to-number): New helper functions.
(calc-choose): New test.
2020-09-14 11:19:22 +02:00
Philipp Stephani
da0e75e741 Add facility to make module functions interactive (Bug#23486).
* src/module-env-28.h: Add field for 'make_interactive' function.

* src/emacs-module.c (Lisp_Module_Function): Add new field holding the
interactive form.
(allocate_module_function): Adapt to structure layout change.
(module_make_interactive, module_function_interactive_form): New
functions.
(initialize_environment): Use them.

* src/eval.c (Fcommandp):
* src/data.c (Finteractive_form): Also handle interactive module
functions.

* test/data/emacs-module/mod-test.c (Fmod_test_identity): New test
function.
(emacs_module_init): Create two interactive module test functions.

* test/src/emacs-module-tests.el (module/interactive/return-t)
(module/interactive/return-t-int, module/interactive/identity):
New unit tests.

* doc/lispref/internals.texi (Module Functions): Document new
function.  Rework paragraph about wrapping module functions, as the
example no longer applies.

* etc/NEWS: Document new facility.
2020-09-13 20:26:47 +02:00
Andrea Corallo
6a726c5ad7 Merge remote-tracking branch 'savannah/master' into HEAD 2020-09-13 18:20:21 +02:00
Lars Ingebrigtsen
c2dea983e8 Kill gpg-agents started by mml-sec-tests (bug#43358) 2020-09-13 16:05:25 +02:00
Michael Albinus
a6321fd799 Fix a conversion failure in tramp-archive-tests (Bug#43353)
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test-file-archive-hexlified): New defun.
(tramp-archive-test02-file-name-dissect): Use it.  (Bug#43353)
2020-09-13 13:25:52 +02:00
Glenn Morris
18f390af8f Don't force LC_ALL=C upon make check (bug#43353)
* test/Makefile.in (TEST_LOCALE): Remove.
(emacs): Don't force LC_ALL=C, since it causes problems with
non-ascii directories.  This mirrors a 7-year old lisp/Makefile change.
2020-09-12 20:22:37 -07:00
Glenn Morris
5e7733694e Mark some diff tests as failing in nonascii directories
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock)
(diff-mode-test-font-lock-syntax-one-line):
Expect failure in non-ascii directories.

; * lisp/vc/diff-mode.el (diff-hunk-file-names): Comment.
2020-09-12 19:47:29 -07:00
Glenn Morris
3e073520b3 Adapt some tests for Emacs's excitingly variable quoting format
* test/lisp/subr-tests.el (subr-test-version-parsing):
* test/lisp/emacs-lisp/gv-tests.el (gv-dont-define-expander-other-file):
* test/src/callint-tests.el (call-interactively/incomplete-multibyte-sequence):
* test/src/emacs-module-tests.el (module/describe-function-1):
Don't fail if curly quotes are in use, as they can be if LC_ALL != C.
2020-09-12 11:57:42 -07:00
Glenn Morris
6818867a2e ; Fix copyright years 2020-09-12 10:56:04 -07:00
Michael Albinus
2fca3015dd Cleanup in dbus.el, dbus-tests.el
* lisp/net/dbus.el (dbus-error-no-reply): New defconst.
(dbus-call-method): Use it.
(dbus-call-method-asynchronously, dbus-register-signal): Fix docstring.
(dbus-unregister-object): Obey :serial entries in
`dbus-registered-objects-table'.

* test/lisp/net/dbus-tests.el (dbus-test04-register-method)
(dbus-test05-register-property): Extend tests.
2020-09-12 19:33:44 +02:00
Glenn Morris
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726)
(vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads):
Make them work with brz 3.1.
2020-09-12 09:51:32 -07:00
Stefan Kangas
7d30ca7f66 Move dired-jump from dired-x to dired (Bug#21981)
* lisp/dired-x.el (dired-bind-jump): Change into defvar and make
obsolete.
(dired-extra-startup): Doc fix.
(dired-jump, dired-jump-other-window): Move from here...
* lisp/dired.el (dired-jump, dired-jump-other-window): ...to here.

* lisp/bindings.el (ctl-x-map, ctl-x-4-map): Bind 'C-j' to
'dired-jump' and 'dired-jump-other-window'.

* doc/misc/dired-x.texi (Features, Installation)
(Miscellaneous Commands): Remove documentation of 'dired-jump'.
* doc/emacs/dired.texi (Dired Enter): Document 'dired-jump' and
dired-jump-other-window.
* etc/NEWS: Announce the above changes.

* test/lisp/dired-tests.el (dired-autoload): Adjust test.
2020-09-12 03:42:37 +02:00
Michael Albinus
dbd8994e0d D-Bus: Implement other compound types of properties
* doc/misc/dbus.texi (Errors and Events):
* etc/NEWS: Mention dbus-show-dbus-errors.

* lisp/net/dbus.el (dbus-compound-types): New defconst.
(dbus): New defgroup.
(dbus-show-dbus-errors): New defcustom.
(dbus-ignore-errors): Use it.
(dbus-set-property): Simplify.
(dbus-property-handler): Implement other compound types of properties.

* test/lisp/net/dbus-tests.el (dbus--test-register-service)
(dbus-test05-register-property): Extend tests.
2020-09-11 15:34:33 +02:00
Mattias Engdegård
c0eee8cb2c Calc: regularise test names
* test/lisp/calc/calc-tests.el (calc-remove-units, calc-extract-units)
(calc-convert-units, calc-bug-23889, calc-trig, calc-format-radix)
(calc-calendar, calc-solve-linear-system):
Use a uniform naming convention (calc- prefix) to simplify test running.
2020-09-11 13:11:43 +02:00
Stefan Kangas
4ba71eee8d Convert indent test for css-mode into automatic test
* test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): New
test.
(css-mode-tests-data-dir): New variable.
* test/manual/indent/css-mode.css: Move from here...
* test/lisp/textmodes/css-mode-resources/test-indent.css: ...to here.
2020-09-10 20:40:34 +02:00
Stefan Kangas
498773447a ; * test/manual/indent/elisp.el: Use lexical-binding. 2020-09-10 20:31:42 +02:00
Stefan Kangas
262d0c6acf Mark some tests as expensive
* test/lisp/autorevert-tests.el
(auto-revert-test00-auto-revert-mode)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired):
* test/lisp/cedet/semantic-utest-c.el
(semantic-test-c-preprocessor-simulation):
* test/lisp/cedet/srecode-utest-getset.el
(srecode-utest-getset-output):
* test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-test-bug24264):
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives-async):
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test04-autorevert)
(file-notify-test05-file-validity, file-notify-test08-backup):
* test/lisp/net/gnutls-tests.el (test-gnutls-005-aead-ciphers):
* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test09-shadow-copy-files):
2020-09-10 20:25:19 +02:00
Stefan Kangas
be4c4a7389 Use lexical-binding in mml-sec-tests.el
* test/lisp/gnus/mml-sec-tests.el: Use lexical-binding.
(mml-secure-test-mail-fixture)
(mml-secure-test-en-decrypt-with-passphrase): Fix warnings.
2020-09-10 19:32:53 +02:00
Stefan Kangas
ba3e2b80c0 * test/lisp/org/org-tests.el: Use lexical-binding. 2020-09-10 19:32:53 +02:00
Stefan Kangas
d32cf354b0 Use lexical-binding in url-future-tests.el
* test/lisp/url/url-future-tests.el: Use lexical-binding.
(url-future-tests--saver): New variable.
(url-future-tests): Use new variable.
2020-09-10 19:32:53 +02:00
Stefan Kangas
88a25960ec Use lexical-binding in semantic-utest-c.el
* test/lisp/cedet/semantic-utest-c.el: Use lexical-binding.
(semantic-test-gcc-output-parser): Fix warning.
2020-09-10 19:32:53 +02:00
Michael Albinus
be5047c0d2 Implement D-Bus properties with compound type.
* lisp/net/dbus.el (dbus-set-property): Fix thinko.
(dbus-register-property, dbus-property-handler): Support compound
properties.

* src/dbusbind.c (dbus-registered-objects-table): Fix docstring.

* test/lisp/net/dbus-tests.el (dbus--test-interface): Make it
different to `dbus--test-service'.
(dbus-test05-register-property)
(dbus-test05-register-property-several-paths): Adapt tests.
2020-09-10 18:49:22 +02:00