1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 17:01:01 -08:00
Commit graph

518 commits

Author SHA1 Message Date
Andrea Corallo
c69c185109 Add comp-test-40187 checking function shadowing. 2020-03-29 12:30:33 +01:00
Andrea Corallo
89cbff32e4 * test/src/comp-tests.el (comp-tests-doc): Fix 2020-03-29 12:30:33 +01:00
Andrea Corallo
3c5e3ca2ba * test/src/comp-test-funcs.el (comp-test-big-interactive): New test 2020-03-29 12:30:33 +01:00
Andrea Corallo
6487d4ac5d Merge remote-tracking branch 'savannah/master' into HEAD 2020-03-04 11:07:53 +00:00
Paul Eggert
5e229f88f9 Fix rounding errors in time conversion
* src/timefns.c (frac_to_double): Pass FLT_RADIX to mpz_sizeinbase
instead of doing the radix calculation ourselves, not always
correctly.  Fix off-by-one error in scale, which caused
double-rounding.
(decode_time_components): Use frac_to_double (via decode_ticks_hz)
to fix double-rounding error that can occur even though
intermediate results are long double.
* test/src/timefns-tests.el (float-time-precision):
Test the above fixes.
2020-03-03 10:20:32 -08:00
Paul Eggert
8ab0e7316a Port timestamp tests to odd timezones, (TICKS . HZ)
* test/src/timefns-tests.el:
(format-time-string-padding-minimal-deletes-unneeded-zeros)
(format-time-string-padding-minimal-retains-needed-zeros)
(format-time-string-padding-spaces)
(format-time-string-padding-zeros-adds-on-insignificant-side):
Don't assume local time can represent 2000-02-15 00:00:00,
as there might be a DST jump over midnight.
Work even when timestamps are of (TICKS . HZ) form.
Simplify by avoiding need to call time-add.
2020-02-27 23:39:29 -08:00
Mattias Engdegård
ef4440a9c8 Revert "Signal an error for the regexp "[:alnum:]""
This reverts commit 8d5e8cddab.
2020-02-27 18:58:05 +01:00
Mattias Engdegård
4859e8db9b Revert "Don't complain about the regexp "[:-:]""
This reverts commit 3766bf728a.
2020-02-27 18:58:05 +01:00
Mattias Engdegård
3766bf728a Don't complain about the regexp "[:-:]"
Suggested by Clément Pit-Claudel.

* src/regex-emacs.c (regex_compile):
* test/src/regex-emacs-tests.el (regexp-invalid): Tolerate ranges.
2020-02-26 22:59:22 +01:00
Mattias Engdegård
8d5e8cddab Signal an error for the regexp "[:alnum:]"
Omitting the extra brackets is a common mistake; see discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00215.html

* src/regex-emacs.c (reg_errcode_t, re_error_msgid): Add REG_ECLASSBR.
(regex_compile): Check for the mistake.
* test/src/regex-emacs-tests.el (regexp-invalid): Test.
* etc/NEWS: Announce.
2020-02-26 22:09:17 +01:00
Mattias Engdegård
770f76f050 Remove subsumed repetitions in regexps
Make regexps smaller and faster by removing terms that are superfluous
by virtue of standing next to another term that matches more.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html
for details.

* lisp/bs.el (bs--make-header-match-string):
* lisp/gnus/deuglify.el (gnus-outlook-repair-attribution-block):
* lisp/gnus/message.el (message-subject-trailing-was-ask-regexp)
(message-subject-trailing-was-regexp):
* lisp/informat.el (Info-validate):
* lisp/net/browse-url.el (browse-url-button-regexp):
* lisp/net/rcirc.el (rcirc-url-regexp):
* lisp/org/ob-core.el (org-babel-remove-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/org-capture.el (org-capture-set-target-location):
* lisp/org/org-table.el (org-table-expand-lhs-ranges):
* lisp/org/org.el (org-maybe-keyword-time-regexp, org-ts-regexp)
(org-ts-regexp-inactive, org-ts-regexp-both):
* lisp/play/gametree.el (gametree-hack-file-layout):
* lisp/progmodes/cc-mode.el (c-Java-defun-prompt-regexp):
* lisp/progmodes/idlw-shell.el (idlwave-shell-halting-error):
* lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding):
* lisp/progmodes/verilog-mode.el (verilog-error-font-lock-keywords)
(verilog-verilint-off, verilog-case-indent-level)
(verilog-within-translate-off, verilog-start-translate-off)
(verilog-back-to-start-translate-off, verilog-end-translate-off)
(verilog-expand-dirnames):
* lisp/term.el (term-control-seq-regexp):
* lisp/textmodes/reftex-vars.el (featurep):
* lisp/url/url-gw.el (url-open-telnet):
* lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp):
* lisp/vc/pcvs-parse.el (cvs-parse-status):
* test/src/regex-emacs-tests.el (regex-tests-PCRE):
Remove subsumed repetitions.
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
Simplify repetition of a repetition.
2020-02-20 16:05:18 +01:00
Glenn Morris
a9e7ae39ce Remove lread tests for a feature that was deleted
* test/src/lread-tests.el (lread-tests--old-style-backquotes)
(lread-tests--force-new-style-backquotes): Remove.
2020-02-14 11:10:55 -08:00
Andrea Corallo
6664f98821 Merge remote-tracking branch 'savannah/master' into HEAD 2020-03-01 19:21:38 +00:00
Andrea Corallo
3130690882 Fix `comp-tests-free-fun'
Address the case were comp-tests.el is byte-compiled.
2020-02-22 10:45:33 +00:00
Andrea Corallo
93f86a2378 Test 'comp-eq' should not assume any string hashing policy 2020-02-21 19:00:59 +00:00
Andrea Corallo
de17b43370 Merge remote-tracking branch 'savannah/master' into HEAD 2020-02-21 15:25:01 +00:00
Andrea Corallo
81c34a35aa Update copyright years plus two style nits 2020-02-16 18:34:22 +01:00
AndreaCorallo
0c6f4caeb3 Clean-up old gc disable refuse in comp-tests-non-locals 2020-02-14 23:26:20 +01:00
Andrea Corallo
f1bc8e480c Merge remote-tracking branch 'savannah/master' into HEAD 2020-02-14 23:22:10 +01:00
Andrea Corallo
15aedf3e3d Merge remote-tracking branch 'savannah/master' into HEAD 2020-02-04 15:11:20 +01:00
Mattias Engdegård
0c6c8aa002 Remove (or double) redundant backslashes in string literals
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html .

* lisp/obsolete/iswitchb.el (iswitchb-summaries-to-end):
* test/src/regex-emacs-tests.el (regex-tests-BOOST-frob-escapes):
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defun, help-fns-test-lisp-defsubst)
(help-fns-test-alias-to-defun, help-fns-test-bug23887):
Double backslashes for desired effect.
* lisp/org/ol.el (org-link-escape):
* lisp/net/nsm.el (nsm-protocol-check--rsa-kx)
(nsm-protocol-check--anon-kx, nsm-protocol-check--sha1-sig):
* lisp/obsolete/old-whitespace.el (whitespace-buffer):
* lisp/obsolete/rcompile.el (remote-compile-run-before):
* lisp/obsolete/vi.el (vi-end-of-blank-delimited-word):
* lisp/obsolete/vip.el (vip-current-major-mode)
(vip-paren-match, vip-switch-to-buffer)
(vip-switch-to-buffer-other-window, vip-kill-buffer)
(vip-get-ex-token, ex-edit):
* lisp/org/org-element.el (org-element--cache-sync-requests):
* lisp/org/org.el (org-sparse-tree):
* lisp/textmodes/reftex.el (reftex-report-bug):
* test/lisp/ibuffer-tests.el (ibuffer-save-filters):
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--insert-failing-lines):
* test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo):
* test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode):
* test/src/regex-emacs-tests.el (regex-tests-compare):
Remove redundant backslashes.
2020-01-24 23:04:34 +01:00
Paul Eggert
6f580542c1 Fix crash when sending Gnus message (Bug#39207)
* src/alloc.c (resize_string_data): The string must be multibyte.
When not bothering to reallocate, do bother to change the byte count.
* test/src/alloc-tests.el (aset-nbytes-change) New test.
2020-01-22 23:44:34 -08:00
Andrea Corallo
a0c6ee6fc5 Do no force speed while running the testsuite 2020-01-20 21:59:40 +00:00
Andrea Corallo
e83bc2503b Always force debug 0 for bootstrap test
Debug symbols would make it fail otherwise.
2020-01-20 21:57:11 +00:00
Paul Eggert
724af76715 Fix sxhash-equal on bytecodes, markers, etc.
Problem reported by Pip Cet (Bug#38912#14).
* doc/lispref/objects.texi (Equality Predicates):
Document better when ‘equal’ looks inside objects.
* doc/lispref/windows.texi (Window Configurations):
Don’t say that ‘equal’ looks inside window configurations.
* etc/NEWS: Mention the change.
* src/fns.c (internal_equal):
Do not look inside window configurations.
(sxhash_obj): Hash markers, byte-code function objects,
char-tables, and font objects consistently with Fequal.
* src/window.c (compare_window_configurations):
Now static.  Remove last argument.  Caller changed.
* test/lisp/ffap-tests.el (ffap-other-window--bug-25352):
Use compare-window-configurations, not ‘equal’.
* test/src/fns-tests.el (test-sxhash-equal): New test.
2020-01-07 11:29:42 -08:00
Philipp Stephani
fc92c2d894 Also print function data when printing module functions.
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function.  Such
a design is common for languages such as Go and C++.

* src/emacs-module.c (module_function_data): New function.

* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.

* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.

* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
2020-01-05 16:07:28 +01:00
Philipp Stephani
fb38d367f4 Make module function finalizer test less brittle.
* test/src/emacs-module-tests.el (module/function-finalizer): Create
100 leaked functions to increase the probability that at least one
gets garbage-collected.
2020-01-04 12:34:10 +01:00
Philipp Stephani
48ffef5ef4 Implement finalizers for module functions (Bug#30373)
* src/module-env-28.h: Add new module environment functions to
module environment for Emacs 28.

* src/emacs-module.h.in: Document that 'emacs_finalizer' also works
for function finalizers.

* src/emacs-module.c (CHECK_MODULE_FUNCTION): New function.
(struct Lisp_Module_Function): Add finalizer data member.
(module_make_function): Initialize finalizer.
(module_get_function_finalizer)
(module_set_function_finalizer): New module environment functions.
(module_finalize_function): New function.
(initialize_environment): Initialize new environment functions.

* src/alloc.c (cleanup_vector): Call potential module function
finalizer during garbage collection.

* test/data/emacs-module/mod-test.c (signal_error): New helper
function.
(memory_full): Use it.
(finalizer): New example function finalizer.
(Fmod_test_make_function_with_finalizer)
(Fmod_test_function_finalizer_calls): New test module functions.
(emacs_module_init): Define them.

* test/src/emacs-module-tests.el (module/function-finalizer): New unit
test.

* doc/lispref/internals.texi (Module Functions): Document new
functionality.
(Module Misc): Move description of 'emacs_finalizer' type to 'Module
Functions' node, and add a reference to it.

* etc/NEWS: Mention new functionality.
2020-01-03 19:24:10 +01:00
Andrea Corallo
6c9acd13d0 single function native compilation doc + interactive support + tests 2020-01-01 11:38:12 +01:00
Andrea Corallo
b3db331e8c add native interactive support test 2020-01-01 11:38:12 +01:00
Andrea Corallo
3345399e87 add native documentation support test 2020-01-01 11:38:12 +01:00
Andrea Corallo
0c94e69fa6 add comp-tests-free-fun 2020-01-01 11:38:09 +01:00
Andrea Corallo
c039822082 better style into comp-tests-bootstrap 2020-01-01 11:38:09 +01:00
Andrea Corallo
d0e6a27664 better ert usage into tests 2020-01-01 11:38:08 +01:00
Andrea Corallo
0c60b3bae7 fix comp-tests-bootstrap 2020-01-01 11:38:07 +01:00
Andrea Corallo
16fe8a4678 allow for pure function call removal optimization 2020-01-01 11:38:07 +01:00
Andrea Corallo
41bfb91f5d add comp-tests-jump-table-2-f 2020-01-01 11:38:07 +01:00
Andrea Corallo
77c9236957 add comp-tests-signal 2020-01-01 11:38:07 +01:00
Andrea Corallo
f7c52087b2 do not force compiler settings within the testsuite 2020-01-01 11:38:06 +01:00
Andrea Corallo
11b34169f8 add comp-tests-trampoline-removal 2020-01-01 11:38:05 +01:00
Andrea Corallo
b91cbf80ae add comp-tests-bootstrap 2020-01-01 11:38:05 +01:00
Andrea Corallo
c9f3679506 compile tests with debug 1 2020-01-01 11:38:03 +01:00
Andrea Corallo
aee75b8771 fix two nits 2020-01-01 11:38:03 +01:00
Andrea Corallo
f97c03ebca add comp-tests-string-trim 2020-01-01 11:38:01 +01:00
Andrea Corallo
9ee6b685a3 add test for macro definition 2020-01-01 11:38:01 +01:00
Andrea Corallo
809bd5aa34 test provide 2020-01-01 11:38:01 +01:00
Andrea Corallo
a18e54f54b add a test for functions with more than 8 arguments 2020-01-01 11:38:00 +01:00
Andrea Corallo
4cc1374786 add comp-test-silly-frame2 to test funcs 2020-01-01 11:37:56 +01:00
Andrea Corallo
0cbe9c204e add comp-test-silly-frame to tests 2020-01-01 11:37:55 +01:00
Andrea Corallo
59035c17d0 add test for recursive calls 2020-01-01 11:37:47 +01:00