summaryrefslogtreecommitdiff
path: root/test/src
Commit message (Collapse)AuthorAgeFilesLines
* ; Copyright year fixGlenn Morris2018-12-191-4/+6
| | | | No need to merge to master
* Backport: Handle unread-command-events consistently (bug#23980)Chris Feng2018-12-191-0/+34
| | | | | | | | | * src/keyboard.c (read_char): Events put into `unread-command-events' with the form (t . EVENT) should always have the t stripped when read out. * test/src/keyboard-tests.el: New tests for `unread-command-events'. (cherry picked from commit 1f3f4b1296613b8cdc0632a68fde86e86ddad866)
* Add regression test for Bug#33014Gemini Lasswell2018-10-301-0/+30
| | | | | | | | Backport from master. * test/src/eval-tests.el: (eval-tests-byte-code-being-evaluated-is-protected-from-gc): New test. (eval-tests-33014-var): New variable. (eval-tests-33014-func, eval-tests-33014-redefine): New functions.
* Avoid adverse side effects of fixing bug#21824Eli Zaretskii2018-09-151-0/+19
| | | | | | | | | | * test/src/buffer-tests.el (overlay-modification-hooks-deleted-overlay): New test. * src/buffer.c (report_overlay_modification): Don't bypass all the overlay-modification hooks; instead, invoke each function only if the buffer associated with the overlay is the current buffer. (Bug#30823)
* Rename thread-alive-p to thread-live-pMichael Albinus2018-08-311-8/+8
| | | | | | | | | | | | | | | * doc/lispref/threads.texi (Basic Thread Functions): Use thread-live-p. * etc/NEWS: 'thread-alive-p' has been renamed to 'thread-live-p'. * src/thread.c (thread_live_p): Rename from thread_alive_p. Adapt all callees. (Fthread_live_p): Rename from Fthread_alive_p. (syms_of_threads): Make thread-alive-p an alias of thread-live-p. * test/src/thread-tests.el (all): Replace `thread-alive-p' by `thread-live-p'. (threads-live): Rename from `threads-alive'.
* Fix detection of freed emacs_values (Bug#32479)Sergey Vinokurov2018-08-251-0/+3
| | | | | | | | | | | * src/emacs-module.c (module_free_global_ref): Compare a value to be freed with all entries of the list. * test/data/emacs-module/mod-test.c (Fmod_test_globref_free): New function. (emacs_module_init): Make it accessible from Lisp. * test/src/emacs-module-tests.el (mod-test-globref-free-test): New test which uses it.
* Add comment about floating point testPaul Eggert2018-08-131-6/+14
| | | | | | | * test/src/data-tests.el (data-tests--float-greater-than-fixnums): New constant. (data-tests-=, data-tests-<, data-tests->, data-tests-<=) (data-tests->=, data-tests-min): Use it.
* Fix copying text properties by 'format'Eli Zaretskii2018-08-091-1/+15
| | | | | | | | | | * src/editfns.c (styled_format): Add the spec beginning index to the info recorded for each format spec, and use it to detect the case that a format spec and its text property end where the next spec with another property begins. (Bug#32404) * test/src/editfns-tests.el (format-properties): Add tests for bug#32404.
* Use consistent function names in thread-tests.elMichael Albinus2018-07-131-8/+9
| | | | | | * test/src/thread-tests.el (threads-call-error, threads-custom) (threads-errors, threads-sticky-point, threads-signal-early): Rename, using naming convention to prefix with "threads-".
* Provide feature 'threadsMichael Albinus2018-07-121-28/+48
| | | | | | | * src/thread.c (syms_of_threads): Provide feature "threads". * test/src/thread-tests.el (top): Declare the functions. (all): Use (featurep 'threads) check.
* Fix 'replace-buffer-contents' in multibyte buffersEli Zaretskii2018-06-151-0/+11
| | | | | | | | | * src/editfns.c (buffer_chars_equal): Pass a byte position to BUF_FETCH_CHAR_AS_MULTIBYTE, not a character position. (Bug#31837) * test/src/editfns-tests.el (replace-buffer-contents-bug31837): New test.
* Fix bug#30846, along with misc cleanups found along the wayStefan Monnier2018-06-031-1/+18
| | | | | | | | | | | | | | | | | | | | | | | * test/src/data-tests.el (data-tests-kill-all-local-variables): New test. * src/buffer.c (swap_out_buffer_local_variables): Remove. Fuse the body of its loop into that of reset_buffer_local_variables. (Fkill_buffer, Fkill_all_local_variables): Don't call it any more. (reset_buffer_local_variables): Make sure the buffer's local binding is swapped out before removing it from the alist (bug#30846). Call watchers before actually killing the var. * src/data.c (Fmake_local_variable): Simplify. Use swap_in_global_binding to swap out any local binding, instead of a mix of find_symbol_value followed by messing with where&found. Don't call swap_in_symval_forwarding since the currently swapped binding is never one we've modified. (Fkill_local_variable): Use swap_in_global_binding rather than messing with where&found to try and trick find_symbol_value into doing the same. * src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more. (cherry picked from commit 3ddff080341580eb6fc18d907181e9cc2301f62d)
* Fix another case of freed markers in the undo-list (Bug#30931)Noam Postavsky2018-06-031-0/+51
| | | | | | | | | | | | * src/alloc.c (free_marker): Remove. * src/editfns.c (save_restriction_restore): * src/insdel.c (signal_before_change): Detach the markers from the buffer when we're done with them instead of calling free_marker on them. * test/src/editfns-tests.el (delete-region-undo-markers-1) (delete-region-undo-markers-2): New tests. (cherry picked from commit 96b8747d5c5d747af13fd84d8fe0308ef2a0ea7a)
* Port collation tests to glibc 2.27Paul Eggert2018-05-021-24/+24
| | | | | | | * test/src/fns-tests.el (fns-tests-collate-strings) (fns-tests-collate-sort): Don’t make unportable assumptions about how en_US.UTF-8 collation works. These assumptions are not true on Fedora 28, which ships with glibc 2.27.
* * test/src/lread-tests.el (lread-test-bug-31186): New test.Eli Zaretskii2018-04-171-0/+8
|
* Avoid memory corruption with specpdl overflow + edebug (Bug#30481)Noam Postavsky2018-02-161-0/+20
| | | | | | | | | | | | If grow_specpdl fails due to outgrowing max_specpdl_size, it will signal an error *before* growing the specpdl array. Therefore, when handling the signal, specpdl_ptr points past the end of the specpdl array and any further use of of specpdl before unwinding (e.g., if edebug binds signal-hook-function) will cause memory corruption. * src/eval.c (signal_or_quit): Don't call `signal-hook-function' if the specpdl_ptr is already past the end of the specpdl array. * test/src/eval-tests.el (eval-tests--exceed-specbind-limit) (eval-exceed-specbind-with-signal-hook): New test & helper function.
* Revert "Signal error for symbol names with strange quotes (Bug#2967)"Noam Postavsky2018-01-281-17/+0
| | | | | | | | | | That commit did not make the corresponding change to printing, thus breaking the (eq (read (prin1-to-string SYM)) SYM) invariant for those symbols. It's too late in the release cycle to change printing behavior, therefore revert the reader change. Don't merge to master, the print function will be updated there (see "Fix round tripping of read->print for symbols with strange quotes").
* Add some test skip conditionsGlenn Morris2018-01-171-24/+52
| | | | | | * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726) (vc-bzr-test-bug9781): Skip if bzr is faulty. * test/src/thread-tests.el: Skip if not compiled with threads.
* Inherit query-on-exit flag to stderr process (Bug#30031)Philipp Stephani2018-01-101-0/+19
| | | | | | | * src/process.c (Fmake_process): Have the pipe process honor the parent's query-on-exit flag. * test/src/process-tests.el (make-process/noquery-stderr): New test.
* Update copyright year to 2018Paul Eggert2018-01-0132-32/+32
| | | | Run admin/update-copyright.
* ; Replace non-ascii quote characters in doc strings etcGlenn Morris2017-12-204-8/+7
|
* Unbreak a fileio test on non-Mac OS X systemsGlenn Morris2017-12-201-1/+4
| | | | | | * test/src/fileio-tests.el (fileio-tests--symlink-failure): Don't use an undefined coding system. ; No need to merge to master, since breaking commit wasn't merged.
* Use utf-8-hfs-unix on macOS (Bug#29712)Alan Third2017-12-161-1/+2
| | | | | | | This is a quick fix for the Emacs 26 release. Do not merge to master. * test/src/fileio-tests.el (fileio-tests--symlink-failure): Override file-name-coding-system to utf-8-hfs-unix to prevent test failure.
* maint: shorten https://lists.gnu.org/archive/html/... linksPaul Eggert2017-11-251-1/+1
|
* Add CAM02 JCh and CAM02-UCS J'a'b' conversionsMark Oteiza2017-09-301-0/+44
| | | | | | | | | | | | * src/lcms.c (rad2deg, parse_jch_list, parse_jab_list, xyz_to_jch): (jch_to_xyz, jch_to_jab, jab_to_jch): New functions. (lcms-jch->xyz, lcms-jch->xyz, lcms-jch->jab, lcms-jab->jch): New Lisp functions. (lcms-cam02-ucs): Refactor. (syms_of_lcms2): Declare new functions. * test/src/lcms-tests.el (lcms-roundtrip, lcms-ciecam02-gold): (lcms-jmh->cam02-ucs-silver): New tests. * etc/NEWS: Mention new functions.
* Expose viewing conditions in CAM02-UCS metricMark Oteiza2017-09-211-5/+32
| | | | | | | | | | | | | | | | Also add tests from the colorspacious library. Finally, catch an errant calculation, where degrees were not being converted to radians. * src/lcms.c (deg2rad, default_viewing_conditions): (parse_viewing_conditions): New functions. (lcms-cam02-ucs): Add comments pointing to references used. Expand the docstring and explain viewing conditions. JCh hue is given in degrees and needs to be converted to radians. (lcms-d65-xyz): Remove. No need to duplicate this in Lisp or make the API needlessly impure. * test/src/lcms-tests.el: Reword commentary. (lcms-rgb255->xyz): New function. (lcms-cri-cam02-ucs): Fix let-binding. (lcms-dE-cam02-ucs-silver): New test, assimilated from colorspacious.
* Fix 2 testsuite tests for MS-WindowsEli Zaretskii2017-09-201-1/+5
| | | | | | | | * test/lisp/ibuffer-tests.el (test-buffer-list): Don't try to create files with "*" in their names. * test/src/editfns-tests.el (format-time-string-with-zone): Adapt results to MS-Windows build. Reported by Fabrice Popineau <fabrice.popineau@gmail.com>.
* Adapt fileio-tests--symlink-failure to CygwinKen Brown2017-09-181-0/+2
| | | | | | * test/src/fileio-tests.el (fileio-tests--symlink-failure) [CYGWIN]: Skip the case of a symlink target starting with '\'; this is treated specially on Cygwin.
* Fix format-time-string %Z bug with negative tzPaul Eggert2017-09-171-0/+4
| | | | | | | * src/editfns.c (tzlookup): Fix sign error in %Z when a purely numeric zone is negative (Bug#28746). * test/src/editfns-tests.el (format-time-string-with-zone): Add test for this bug.
* Fix bug with min and max and NaNsPaul Eggert2017-09-171-1/+5
| | | | | | * src/data.c (minmax_driver): Fix bug with (min 0 NaN), which mistakenly yielded 0. Also, pacify GCC in a better way. * test/src/data-tests.el (data-tests-min): Test for the bug.
* * test/src/lcms-tests.el (lcms-cri-cam02-ucs): Skip if lcms2 not present.Glenn Morris2017-09-161-0/+1
|
* * test/src/lcms-tests.el (lcms-whitepoint): Skip if lcms2 not present.Glenn Morris2017-09-161-1/+2
| | | | (cherry picked from commit 8081df26911c63aadfce4ee8f6a7223d814baeaf)
* Add lisp variable lcms-d65-xyzMark Oteiza2017-09-161-0/+19
| | | | | | | | | | This serves as the default optional argument for functions in this library. * src/lcms.c (lcms-d65-xyz): New variable. (lcms-cam02-ucs): Use it. Use better word in docstring. Fix bug color1 -> color2. * test/src/lcms-tests.el: Add some tests for lcms-cri-cam02-ucs. (lcms-colorspacious-d65): New variable.
* Add lcms-temp->white-point and initial testsMark Oteiza2017-09-151-0/+69
| | | | | * src/lcms.c (lcms-temp->white-point): New function. * test/src/lcms-tests.el: New file.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-1331-34/+34
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Fix 'directory-file-name' on DOS_NT systems as wellEli Zaretskii2017-09-081-0/+30
| | | | | | | | | | * src/fileio.c (directory_file_name) [DOS_NT]: Fix the DOS_NT case to be consistent with last change. * test/src/fileio-tests.el (fileio-tests--odd-symlink-chars): Disable on MS-Windows. (fileio-tests--directory-file-name-dos-nt) (fileio-tests--file-name-as-directory-dos-nt): New tests.
* Fix bug: (directory-file-name "///") returned "//"Paul Eggert2017-09-071-0/+19
| | | | | | | * src/fileio.c (directory_file_name): For "///" and longer, return "/", not "//", as per POSIX. * test/src/fileio-tests.el (fileio-tests--directory-file-name) (fileio-tests--file-name-as-directory): New tests.
* Improve error messages for improper plists (Bug#27726)Philipp Stephani2017-09-021-0/+28
| | | | | | | | | | | | * src/fns.c (Fplist_put, Flax_plist_get, Flax_plist_put) (Fplist_member, syms_of_fns): Use ‘plistp’ as pseudo-predicate for improper plists instead of ‘listp.’ * test/src/fns-tests.el (plist-get/odd-number-of-elements) (lax-plist-get/odd-number-of-elements) (plist-put/odd-number-of-elements) (lax-plist-put/odd-number-of-elements) (plist-member/improper-list): Add unit tests.
* Do not munge contents of local symbolic linksPaul Eggert2017-08-261-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | This lets Emacs deal with arbitrary local symlinks without mishandling their contents (Bug#28156). For example, (progn (shell-command "ln -fs '~' 'x'") (rename-file "x" "/tmp/x")) now consistently creates a symbolic link from '/tmp/x' to '~'. Formerly, it did that only if the working directory was on the same filesystem as /tmp; otherwise, it expanded the '~' to the user's home directory. * lisp/dired.el (dired-get-filename): Use files--name-absolute-system-p instead of rolling our own code. * lisp/files.el (files--name-absolute-system-p): New function. (file-truename, file-chase-links): Use it to avoid mishandling symlink contents that begin with ~. (copy-directory, move-file-to-trash): Use concat rather than expand-file-name, to avoid mishandling symlink contents that begin with ~. * src/fileio.c (Fmake_symbolic_link): Do not expand leading "~" in the target unless interactive. Strip leading "/:" if interactive. (emacs_readlinkat): Do not prepend "/:" to the link target if it starts with "/" and contains ":" before NUL. * test/src/fileio-tests.el (try-link): Rename from try-char, and accept a string instead of a char. All uses changed. (fileio-tests--symlink-failure): Also test leading ~, and "/:", to test the new behavior.
* Change recent symlink tests to just test ASCIIPaul Eggert2017-08-191-4/+2
| | | | | | * test/src/fileio-tests.el (fileio-tests--symlink-failure): Be less ambitious about testing non-ASCII chars and encoding errors, as there are too many portability issues.
* Don’t adjust CRLF in file namesPaul Eggert2017-08-191-0/+49
| | | | | | | | | | | | | * doc/misc/gnus.texi (Non-ASCII Group Names): * etc/NEWS: * test/lisp/net/tramp-tests.el (tramp--test-utf8): Use utf-8-unix, not utf-8, for default-file-name-coding-system, so that CRLF in file names is left alone. * lisp/international/mule-cmds.el (set-default-coding-systems): Do not alter CRLF in file name coding systems. (prefer-coding-system): Ignore differences in CRLF processing when checking whether we used the user-specified file name coding system. * test/src/fileio-tests.el: New file.
* Fix crashing emacs-module tests on MS-WindowsEli Zaretskii2017-08-091-4/+12
| | | | | | | | | | | | * src/w32fns.c (syms_of_w32fns) <w32-disable-abort-dialog>: New variable. (emacs_abort): If w32-disable-abort-dialog is non-nil, abort right away, without displaying the Abort dialog, which waits for the user. * test/src/emacs-module-tests.el (module--test-assertion): Run the inferior Emacs with the w32 abort dialog disabled. Expect the status of the aborted Emacs sub-process to be 3 on MS-Windows and 2 on MS-DOS.
* Fix some crashes on self-modifying Elisp codePaul Eggert2017-08-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Prompted by a problem report by Alex in: http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html * src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub): Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs, it is likely to run a bit faster with typical hardware caches. (Fif): Use Fcdr instead of XCDR, to avoid crashing on self-modifying S-expressions. (Fsetq, Flet, eval_sub): Count the number of arguments as we go instead of trusting an Flength prepass, to avoid problems when the code is self-modifying. (Fquote, Ffunction, Fdefvar, Fdefconst): Prefer !NILP to CONSP where either will do. This is mostly to document the fact that the value must be a proper list. It's also a tiny bit faster on typical machines nowadays. (Fdefconst, FletX): Prefer XCAR+XCDR to Fcar+Fcdr when either will do. (eval_sub): Check that the args are a list as opposed to some other object that has a length. This prevents e.g. (if . "string") from making Emacs dump core in some cases. * test/src/eval-tests.el (eval-tests--if-dot-string) (eval-tests--let-with-circular-defs, eval-tests--mutating-cond): New tests.
* Fix a bug in 'generate-new-buffer-name'Eli Zaretskii2017-08-051-0/+5
| | | | | | | | | * src/buffer.c (Fgenerate_new_buffer_name): Test IGNORE for being nil before calling string-equal, since the latter will compare "nil and 'nil' as equal. (Bug#27966) * test/src/buffer-tests.el (test-generate-new-buffer-name-bug27966): New test.
* Signal error for symbol names with strange quotes (Bug#2967)Noam Postavsky2017-07-221-0/+17
| | | | | | | | * src/lread.c (read1): Signal an error when a symbol starts with a non-escaped quote-like character. * test/src/lread-tests.el (lread-tests--funny-quote-symbols): New test. * etc/NEWS: Announce change.
* Add an optional testfn parameter to assocNicolas Petton2017-07-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | * src/fns.c (assoc): New optional testfn parameter used for comparison when provided. * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new 'testfn' parameter. * src/buffer.c: * src/coding.c: * src/dbusbind.c: * src/font.c: * src/fontset.c: * src/gfilenotify.c: * src/image.c: * src/keymap.c: * src/process.c: * src/w32fns.c: * src/w32font.c: * src/w32notify.c: * src/w32term.c: * src/xdisp.c: * src/xfont.c: Add a third argument to Fassoc calls. * etc/NEWS: * doc/lispref/lists.texi: Document the new 'testfn' parameter.
* Fix failing module tests on GNU/LinuxGlenn Morris2017-07-091-2/+2
| | | | | | | * test/src/emacs-module-tests.el (module--test-assertions--load-non-live-object) (module--test-assertions--call-emacs-from-gc): Avoid test failures due to backtraces.
* Fix core dump in substitute-object-in-subtreePaul Eggert2017-07-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this fix, (substitute-object-in-subtree #0=(#0# 'a) 'a) would dump core, since the C code would recurse indefinitely through the infinite structure. This patch adds an argument to the function, and renames it to lread--substitute-object-in-subtree as the function is not general-purpose and should not be relied on by outside code. See Bug#23660. * src/intervals.c (traverse_intervals_noorder): ARG is now void *, not Lisp_Object, so that callers need not cons unnecessarily. All callers changed. Also, remove related #if-0 code that was “temporary” in the early 1990s and has not been compilable for some time. * src/lread.c (struct subst): New type, for substitution closure data. (seen_list): Remove this static var, as this info is now part of struct subst. All uses removed. (Flread__substitute_object_in_subtree): Rename from Fsubstitute_object_in_subtree, and give it a 3rd arg so that it doesn’t dump core when called from the top level with an already-cyclic structure. All callers changed. (SUBSTITUTE): Remove. All callers expanded and then simplified. (substitute_object_recurse): Take a single argument SUBST rather than a pair OBJECT and PLACEHOLDER, so that its address can be passed around as part of a closure; this avoids the need for an AUTO_CONS call. All callers changed. If the COMPLETED component is t, treat every subobject as potentially circular. (substitute_in_interval): Take a struct subst * rather than a Lisp_Object, for the closure data. All callers changed. * test/src/lread-tests.el (lread-lread--substitute-object-in-subtree): New test, to check that the core dump does not reoccur.
* Module assertions: check for garbage collectionsPhilipp Stephani2017-07-081-29/+58
| | | | | | | | | | | | | | | | | | | | It's technically possible to write a user pointer finalizer that calls into Emacs module functions. This would be disastrous because it would allow arbitrary Lisp code to run during garbage collection. Therefore extend the module assertions to check for this case. * src/emacs-module.c (module_assert_thread): Also check whether a garbage collection is in progress. * test/data/emacs-module/mod-test.c (invalid_finalizer) (Fmod_test_invalid_finalizer): New test module functions. (emacs_module_init): Register new test function. * test/src/emacs-module-tests.el (module--test-assertion) (module--with-temp-directory): New helper macros. (module--test-assertions--load-non-live-object): Rename existing unit test, use helper macros. (module--test-assertions--call-emacs-from-gc): New unit test.
* Add command to replace buffer contentsPhilipp Stephani2017-06-171-0/+31
| | | | | | | | | | | | | | | | | Add a new command 'replace-buffer-contents' that uses the Myers diff algorithm to non-destructively replace the accessible portion of the current buffer. The Myers algorithm is implemented in Gnulib. * src/editfns.c (Freplace_buffer_contents): New command. (set_bit, bit_is_set, buffer_chars_equal): New helper functions. (syms_of_editfns): Define new command. * test/src/editfns-tests.el (replace-buffer-contents-1) (replace-buffer-contents-2): New unit tests. * src/buffer.h (BUF_FETCH_CHAR_AS_MULTIBYTE): New helper macro. * admin/merge-gnulib (GNULIB_MODULES): Add diffseq.h and minmax.h.