summaryrefslogtreecommitdiff
path: root/test/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use lexical-binding in most src testsStefan Kangas2020-04-2415-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/charset-tests.el: * test/src/chartab-tests.el: * test/src/cmds-tests.el: * test/src/coding-tests.el (top-level) (generate-ascii-file, generate-mostly-nonascii-file): * test/src/doc-tests.el: * test/src/floatfns-tests.el: * test/src/font-tests.el: * test/src/keymap-tests.el: * test/src/process-tests.el (top-level) (process-test-sentinel-wait-function-working-p) (process-test-stderr-buffer, process-test-stderr-filter): * test/src/textprop-tests.el: * test/src/thread-tests.el: * test/src/timefns-tests.el: * test/src/undo-tests.el: * test/src/xml-tests.el: Use lexical-binding.
* | Fix string-to-multibyte overlong sequence bugPaul Eggert2020-04-201-0/+14
| | | | | | | | | | | | | | | | | | * src/character.h (MULTIBYTE_LENGTH, MULTIBYTE_LENGTH_NO_CHECK): Remove, replacing with ... (multibyte_length): ... this new function. All callers changed. The new function rejects overlong multibyte forms. * test/src/buffer-tests.el (buffer-multibyte-overlong-sequences): New test.
* | Merge from origin/emacs-27Glenn Morris2020-04-201-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 05089a4d65 (origin/emacs-27) Tweak wording re constant variables a1040861f1 Tweak setcar-related wording 751510f865 * lisp/image-mode.el: Add prefix key 's' and reduce depend... 9261a219ec * doc/emacs/windows.texi (Window Convenience): Decribe mor... e1d42da0d6 Fix mutability glitches reported by Drew Adams 5805df74f5 Improve mutability doc dca35b31d0 Improve mutability documentation 81e7d7f111 Document that quoting yields constants 5734339f40 * doc/lispref/keymaps.texi (Extended Menu Items, Easy Menu... 14a570afae Remove #' and function quoting from lambda forms in manual d5ec18c66b * src/regex-emacs.c (re_match_2_internal): Rework comment ... 4df8a61117 Add new node "Image Mode" to Emacs Manual. d7d5ee6c57 ; Fix a typo in cmdargs.texi (bug#40701) 5e9db48fbe * doc/lispref/display.texi (Customizing Bitmaps): Fix typo. eebfb72c90 Document constant vs mutable objects better 6c187ed6b0 Improve documentation of 'sort-lines' 52288f4b66 Mention 'spam-stat-process-directory-age' in the documenta... 067b070598 ; Fix some typos and doc issues (bug#40695) # Conflicts: # etc/NEWS
| * ; Fix some typos and doc issues (bug#40695)Štěpán Němec2020-04-181-1/+1
| |
* | Fix error in 'call-process-region' when START is nil (Bug#40576)Philipp Stephani2020-04-121-0/+10
| | | | | | | | | | | | | | | | * src/callproc.c (Fcall_process_region): Fix behavior when START is nil and DELETE is non-nil. * test/src/callproc-tests.el (call-process-region-entire-buffer-with-delete): New unit test.
* | ; * test/src/callproc-tests.el: Fix checkdoc errors.Philipp Stephani2020-04-121-0/+7
| |
* | Set last-coding-system-used upon ASCII conversion bypass (bug#40407)Mattias Engdegård2020-04-091-1/+2
| | | | | | | | | | | | | | | | Spotted by Kazuhiro Ito. * src/coding.c (code_convert_string): Set Vlast_coding_system if appropriate. * test/src/coding-tests.el (coding-nocopy-ascii): Add test.
* | Fix ASCII-only conversion logic (bug#40407)Mattias Engdegård2020-04-091-12/+21
| | | | | | | | | | | | | | | | | | | | | | To sidestep conversion altogether when EOL conversion applies, we must either be encoding a string without NL, or decoding without CR. * src/coding.c (string_ascii_p): Revert to a pure predicate. (code_convert_string): Fix logic. Don't use uninitialised ascii_p (removed). Use memchr to detect CR or LF in string when needed. * test/src/coding-tests.el (coding-nocopy-ascii): Update tests to include encodings with explicit EOL conversions.
* | Don't crash with invalid argument in check-coding-systems-regionMattias Engdegård2020-04-091-0/+8
| | | | | | | | | | | | | | * src/coding.c (Fcheck_coding_systems_region): Don't crash if the third arg contains something that isn't a coding system. * test/src/coding-tests.el (coding-check-coding-systems-region): New test.
* | Fix decoding ASCII strings with embedded CR charactersEli Zaretskii2020-04-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | * src/coding.c (string_ascii_p): Return a negative value if an all-ASCII string STR includes the CR character, otherwise a positive value. (code_convert_string): If the string is ASCII, but includes CR characters, use the fast path only if EOL doesn't need to be decoded. (Bug#40519) * test/src/coding-tests.el (coding-nocopy-ascii): Add tests for bug#40519.
* | Avoid expensive recoding for ASCII identity cases (bug#40407)Mattias Engdegård2020-04-051-0/+11
| | | | | | | | | | | | | | | | | | | | Optimise for the common case of encoding or decoding an ASCII-only string using an ASCII-compatible coding, for file names in particular. * src/coding.c (string_ascii_p): New function. (code_convert_string): Return the input string for ASCII-only inputs and ASCII-compatible codings. * test/src/coding-tests.el (coding-nocopy-ascii): New test.
* | Fix inverted NOCOPY encode/decode parameter (bug#40407)Mattias Engdegård2020-04-051-0/+8
| | | | | | | | | | | | | | | | | | | | In {encode,decode}-coding-string, the NOCOPY parameter had the opposite effect to what was intended and documented. This 18 year old bug (introduced in 4031e2bf0a) only affected calls with CODING-SYSTEM being nil. * src/coding.c (code_convert_string): Correct use of NOCOPY. * test/src/coding-tests.el (coding-nocopy-trivial): New test.
* | Port the 'module/async-pipe' test to MS-WindowsEli Zaretskii2020-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes let the code compile and produce a valid DLL, but the test hangs. It looks like the hang is in Fdelete_process, when it closes one of the descriptors of the pipe process. In addition, this use of the pipe process cannot currently work on MS-Windows, since make-pipe-process doesn't set up the reader thread to read from the Emacs's side of the pipe, so the select emulation doesn't know there's stuff to read from that pipe. * test/data/emacs-module/mod-test.c [WINDOWSNT]: Include windows.h. (ALIGN_STACK) [!__x86_64__]: Define for 32-bit builds. (sleep_for_half_second): New function. (write_to_pipe): Declare return type differently for WINDOWSNT. Call sleep_for_half_second. (Fmod_test_async_pipe) [WINDOWSNT]: Use _beginthread as substitute for pthread_create. (invalid_finalizer): Replace non_ASCII character in a comment. * test/src/emacs-module-tests.el (module/async-pipe): Skip on MS-Windows, as the test fails and then hangs.
* | Add a module function to open a file descriptor connected to a pipe.Philipp Stephani2020-03-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common complaint about the module API is that modules can't communicate asynchronously with Emacs. While it isn't possible to call arbitrary Emacs functions asynchronously, writing to a pipe should always be fine and is a pretty low-hanging fruit. This patch implements a function that adapts an existing pipe process. That way, users can use familiar tools like process filters or 'accept-process-output'. * src/module-env-28.h: Add 'open_channel' module function. * src/emacs-module.c (module_open_channel): Provide definition for 'open_channel'. (initialize_environment): Use it. * src/process.c (open_channel_for_module): New helper function. (syms_of_process): Define necessary symbol. * test/src/emacs-module-tests.el (module/async-pipe): New unit test. * test/data/emacs-module/mod-test.c (signal_system_error): New helper function. (signal_errno): Use it. (write_to_pipe): New function running in the background. (Fmod_test_async_pipe): New test module function. (emacs_module_init): Export it. * doc/lispref/internals.texi (Module Misc): Document new module function. * doc/lispref/processes.texi (Asynchronous Processes): New anchor for pipe processes. * etc/NEWS: Document 'open_channel' function.
* | Fix rounding errors in time conversionPaul Eggert2020-03-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Port timestamp tests to odd timezones, (TICKS . HZ)Paul Eggert2020-02-271-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Revert "Signal an error for the regexp "[:alnum:]""Mattias Engdegård2020-02-271-5/+0
| | | | | | | | This reverts commit 8d5e8cddab732ac90e9ae930c63f7830f9dab24f.
* | Revert "Don't complain about the regexp "[:-:]""Mattias Engdegård2020-02-271-2/+1
| | | | | | | | This reverts commit 3766bf728a43933083f4525970bcf9fdace3838d.
* | Don't complain about the regexp "[:-:]"Mattias Engdegård2020-02-261-1/+2
| | | | | | | | | | | | | | Suggested by Clément Pit-Claudel. * src/regex-emacs.c (regex_compile): * test/src/regex-emacs-tests.el (regexp-invalid): Tolerate ranges.
* | Signal an error for the regexp "[:alnum:]"Mattias Engdegård2020-02-261-0/+5
| | | | | | | | | | | | | | | | | | | | 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.
* | Remove subsumed repetitions in regexpsMattias Engdegård2020-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Remove lread tests for a feature that was deletedGlenn Morris2020-02-141-16/+0
| | | | | | | | | | * test/src/lread-tests.el (lread-tests--old-style-backquotes) (lread-tests--force-new-style-backquotes): Remove.
* | Remove (or double) redundant backslashes in string literalsMattias Engdegård2020-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix crash when sending Gnus message (Bug#39207)Paul Eggert2020-01-221-0/+7
| | | | | | | | | | | | * 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.
* | Fix sxhash-equal on bytecodes, markers, etc.Paul Eggert2020-01-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Also print function data when printing module functions.Philipp Stephani2020-01-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Make module function finalizer test less brittle.Philipp Stephani2020-01-041-5/+17
| | | | | | | | | | | | * test/src/emacs-module-tests.el (module/function-finalizer): Create 100 leaked functions to increase the probability that at least one gets garbage-collected.
* | Implement finalizers for module functions (Bug#30373)Philipp Stephani2020-01-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge from origin/emacs-27Paul Eggert2020-01-0136-36/+36
|\ \ | |/ | | | | | | | | | | | | | | | | | | 186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3 4cd143aded Fix copyright years by hand 365e01cc9f Update copyright year to 2020 cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac... # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex
| * Update copyright year to 2020Paul Eggert2020-01-0136-36/+36
| | | | | | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* | Support .dylib suffix for modules on macOS (Bug#36226).Philipp Stephani2019-12-251-0/+18
|/ | | | | | | | | | | | | | | | On macOS, shared libraries typically have the suffix .dylib. This commit switches the module suffix to .dylib on Darwin to account for that. To also support the .so suffix, introduce the concept of a secondary module suffix. * configure.ac: Switch MODULES_SUFFIX to .dylib for Darwin, introduce MODULES_SECONDARY_SUFFIX. * src/lread.c (Fload, syms_of_lread): Also use MODULES_SECONDARY_SUFFIX if defined. * test/src/emacs-module-tests.el (module-darwin-secondary-suffix): New unit test.
* ; Spelling fixesPaul Eggert2019-12-102-7/+7
|
* Spelling fixesPaul Eggert2019-12-093-4/+4
|
* Test format-time-string paddingPaul Eggert2019-12-061-0/+43
| | | | | | | | | | Adapted from tests written by Stephen Gildea. * 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): New tests.
* * test/src/buffer-tests.el: Add loads of overlay testsAndreas Politz2019-12-051-0/+1219
| | | | | Taken from the `feature/noverlay` branch. Suggested by Vladimir Kazanov <vekazanov@gmail.com>.
* Fix recent modifications in emacs-module-testsEli Zaretskii2019-12-051-2/+6
| | | | | | | | | | | | * test/data/emacs-module/mod-test.c (extract_big_integer): Fix calculation of size of 'magnitude' when 'emacs_limb_t' is wider than 'unsigned long'. * test/src/emacs-module-tests.el (module--test-assertions--load-non-live-object) (module--test-assertions--call-emacs-from-gc): On MS-Windows, check also mod-test-emacs with ".exe" appended, before skipping the tests.
* Stop signaling an error when reading "smart quotes" in symbolsNoam Postavsky2019-11-281-17/+0
| | | | | | | | | | | Revert commits from 2018-01-28 "Fix round tripping of read->print for symbols with strange quotes", and 2017-07-22 "Signal error for symbol names with strange quotes (Bug#2967)". * etc/NEWS: Remove corresponding entries. * src/character.c (confusable_symbol_character_p): * test/src/lread-tests.el (lread-tests--old-style-backquotes): Remove. * src/lread.c (read1): Don't signal error on confusable character. * src/print.c (print_object): Don't escape confusable characters.
* Handle weird cases like (ceil 0 0.0)Paul Eggert2019-11-141-13/+11
| | | | | | | | | | | * src/floatfns.c (double_integer_scale): Distinguish Inf from NaN. (rounding_driver): Handle (ceil 0 0.0) and (ceil 0 1.0e+INF). * test/src/floatfns-tests.el (special-round): Add tests for weird cases like this. Avoid crash with (floor 0 0.0) * src/floatfns.c (rounding_driver): Signal an arithmetic error if divisor is 0.0 or -0.0, instead of crashing.
* Fix byte-counting error in ‘format’Paul Eggert2019-11-141-0/+4
| | | | | | | Problem reported by Paul Pogonyshev (Bug#38191). * src/editfns.c (styled_format): When checking for adjacent %-sequences, use byte position rather than character position. * test/src/editfns-tests.el (format-properties): Test for fix.
* Fix double-rounding bug in ceiling etc.Paul Eggert2019-11-131-1/+3
| | | | | | | | | | | | This is doable now that we have bignums. * src/floatfns.c (integer_value): Remove; no longer used. (rescale_for_division): New function. (rounding_driver): Use it to divide properly (by using bignums) even when arguments are float, fixing a double-rounding FIXME. * src/lisp.h (LOG2_FLT_RADIX): Move here ... * src/timefns.c (frac_to_double): ... from here. * test/src/floatfns-tests.el (big-round): Add a test to catch the double-rounding bug.
* Fix some quoting glitches in doc stringsPaul Eggert2019-11-111-1/+1
|
* Disable a portion of one doc-testGlenn Morris2019-11-091-30/+33
| | | | | | * test/src/doc-tests.el (doc-test-substitute-command-keys): Disable component that fails twice in the past 5 weeks due to changes in the minibuffer map.
* Fix case-insensitive completion of buffer namesEli Zaretskii2019-11-091-0/+11
| | | | | | | | | | | * test/src/minibuf-tests.el (test-try-completion-ignore-case): New test, suggested by Stefan Monnier <monnier@iro.umontreal.ca>. * src/minibuf.c (Ftry_completion): Don't treat strings that are identical but for the case as if they were identical for the purposes of not counting the same string twice. This fixes case-insensitive completion when all the candidates are identical but for the letter-case. (Bug#11339)
* Ensure building and running on non-IPv6 capable hosts worksRobert Pluim2019-11-081-5/+6
| | | | | | | | | | | * src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1 localhost when IPv6 is supported. (Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside ifdef, since its definition depends on AF_INET6. Don't return IPv6 addresses when they're not supported. * test/src/process-tests.el (lookup-family-specification, lookup-google): Only do IPv6 lookup if IPv6 is supported.
* Don’t signal overflow for (expt 1 bignum)Paul Eggert2019-11-041-0/+5
| | | | | | | | Similarly for (expt 0 bignum) and (expt -1 bignum). The result is always a -1, 0 or 1, so do not signal overflow. * src/data.c (expt_integer): Do not signal an overflow if -1 <= X <= 1. Be clearer about when overflow is signaled. * test/src/floatfns-tests.el (bignum-expt): Test this.
* Fix print.c infloop on circular listsPaul Eggert2019-10-301-1/+5
| | | | | | | | | | | | | | Fix infinite loops in print.c when a circular list is passed to command-error-default-function or to error-message-string. * src/print.c (print_error_message): Use FOR_EACH_TAIL to avoid infloop on circular lists. (print_object): Use FOR_EACH_TAIL_SAFE, as it uses Brent’s teleporting tortoise-hare algorithm which is asymptotically better than the classic tortoise-hare algorithm that the code wsas using. * test/src/print-tests.el (print-circle-2): When print-circle is nil, do not insist on a particular cycle-detection heuristic. (error-message-string-circular): New test.
* Fix fileio.c infloops on circular listsPaul Eggert2019-10-301-0/+9
| | | | | | | | | | | | | Fix infinite loops in fileio.c when a circular list is the value of after_insert_file_functions, buffer-auto-save-file-format, buffer-file-format, or write-region-annotate-functions. * src/fileio.c (Finsert_file_contents, build_annotations): Use FOR_EACH_TAIL to avoid infloop on circular lists. (build_annotations): Use an EMACS_INT, not an int, to count nesting level. * test/src/fileio-tests.el: (fileio-tests--circular-after-insert-file-functions): New test.
* Add tests for secure-hash and improve doc string (Bug#37420)Stefan Kangas2019-10-041-0/+18
| | | | | | * 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.
* Update a substitute-command-keys testGlenn Morris2019-10-011-0/+1
| | | | | * test/src/doc-tests.el (doc-test-substitute-command-keys): Update for recent minibuffer map change.
* Remove support for destructive splicing in elispStefan Kangas2019-09-261-0/+7
| | | | | | | | | | * src/lread.c (read1): Don't handle destructive splicing in backquote expressions (e.g. ",.<identifier>"). (Bug#19790) (syms_of_lread): Remove Qcomma_dot. * src/print.c (print_object): Don't check for Qcomma_dot. * test/src/eval-tests.el (eval-tests-19790-backquote-comma-dot-substitution): New test. * etc/NEWS: Announce it.